/* New Team page (opt-in team feature `teamPageV2`). EVERY rule hangs off html.tp2, which public/js/team-page-v2.js sets only while the
   feature is on. With the feature off none of this matches anything, so the Team page is exactly the old one. Theme tokens only. */

/* ── header ───────────────────────────────────────────────────────── */
html.tp2 #page-team .page-content { max-width: 1240px; }
html.tp2 #page-team .page-content > .mb-24 { margin-bottom: 22px; }
html.tp2 #page-team #team-page-title { font-family: var(--font-body) !important; font-size: 36px !important; font-weight: 700 !important; letter-spacing: -0.5px; line-height: 1.1; color: var(--white); }
html.tp2 #page-team #team-page-subtitle { margin-top: 6px; font-size: 14px !important; color: var(--off-white); }
html.tp2 #tp2-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--off-white); margin-bottom: 6px; }
html.tp2 #page-team #team-online-badge { border-radius: 999px !important; padding: 8px 16px !important; font-weight: 600; font-size: 12.5px !important; }

/* ── count cards (the shared thin card) ───────────────────────────── */
html.tp2 .tp2-kpis.wf-kpi-rail { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; overflow: visible; --wf-kpi-cardw: 0px; }
html.tp2 .tp2-kpis > .pay-kpi { width: auto !important; min-width: 0 !important; max-width: none !important; flex: none !important; cursor: pointer; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; min-height: 0 !important; box-shadow: none; transition: border-color .15s; }
html.tp2 .tp2-kpis > .pay-kpi:hover { border-color: var(--blue, var(--gold)); }
html.tp2 .tp2-kpis > .pay-kpi:focus-visible { outline: 2px solid var(--blue, var(--gold)); outline-offset: 2px; }
html.tp2 .tp2-kpis .wf-kpi-ic { width: 38px; height: 38px; min-width: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--blue, var(--gold)); background: color-mix(in srgb, var(--blue, var(--gold)) 11%, transparent); }
html.tp2 .tp2-kpis .wf-kpi-ic svg { width: 19px; height: 19px; }
html.tp2 .tp2-kpis .wf-kpi-ic[data-ic="runner"] { color: var(--purple, var(--blue)); background: color-mix(in srgb, var(--purple, var(--blue)) 11%, transparent); }
html.tp2 .tp2-kpis .wf-kpi-ic[data-ic="invite"] { color: var(--amber, var(--gold)); background: color-mix(in srgb, var(--amber, var(--gold)) 13%, transparent); }
html.tp2 .tp2-kpis .wf-kpi-ic[data-ic="live"] { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
html.tp2 .tp2-kpis .wf-kpi-ic[data-ic="bolt"] { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
html.tp2 .tp2-kpis .wf-kpi-ic[data-ic="cal"] { color: var(--off-white); background: color-mix(in srgb, var(--off-white) 12%, transparent); }
html.tp2 .tp2-kpis .wf-kpi-body { min-width: 0; display: grid; gap: 2px; }
html.tp2 .tp2-kpis .pay-kpi-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--off-white); white-space: normal; line-height: 1.25; margin: 0; }
html.tp2 .tp2-kpis .pay-kpi-value { font-size: 24px; font-weight: 700; color: var(--white); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
/* the old dashboard card is replaced by the cards above and the status pills in the list; its data still loads */
html.tp2 #team-dashboard-card { display: none !important; }
html.tp2 #team-pending-card { display: none !important; }   /* pending invitations are rows in the list now */

/* ── cards on the page ────────────────────────────────────────────── */
html.tp2 #page-team .card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; box-shadow: none; overflow: hidden; }
html.tp2 #page-team .card-header { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
html.tp2 #page-team .card-header-title { font-family: inherit !important; font-size: 12px !important; font-weight: 700 !important; letter-spacing: 1.4px !important; text-transform: uppercase; color: var(--white); }
html.tp2 #page-team #team-seat-info { font-size: 12px !important; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--off-white) !important; }

/* ── toolbar: search + filter pills ───────────────────────────────── */
html.tp2 .tp2-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--border); }
html.tp2 .tp2-search { position: relative; flex: 1 1 280px; min-width: 0; display: flex; align-items: center; margin: 0; }
html.tp2 .tp2-search svg { position: absolute; left: 14px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
html.tp2 .tp2-search input { width: 100%; min-height: 46px; padding: 0 14px 0 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-panel, #fff); color: var(--white); font-size: 15px; }
html.tp2 .tp2-search input:focus { outline: 2px solid var(--blue, var(--gold)); outline-offset: 0; border-color: transparent; }
html.tp2 .tp2-pills { display: flex; gap: 8px; flex-wrap: wrap; }
html.tp2 .tp2-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-panel, #fff); color: var(--off-white); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
html.tp2 .tp2-pill:hover { color: var(--white); border-color: var(--blue, var(--gold)); }
html.tp2 .tp2-pill.active { background: var(--blue, var(--gold)); border-color: var(--blue, var(--gold)); color: #fff; }
html.tp2 .tp2-pill-n { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); font-variant-numeric: tabular-nums; }

/* ── the list ─────────────────────────────────────────────────────── */
html.tp2 #page-team #team-members-list { padding: 0 !important; }
html.tp2 .tp2-head, html.tp2 .tp2-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(130px, .9fr) minmax(0, 1.5fr) 128px; gap: 16px; align-items: center; padding: 0 22px; }
html.tp2 .tp2-head { padding-top: 12px; padding-bottom: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--off-white); border-bottom: 1px solid var(--border); }
html.tp2 .tp2-row { min-height: 72px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
html.tp2 .tp2-row:last-child { border-bottom: 0; }
html.tp2 .tp2-row:hover { background: color-mix(in srgb, var(--blue, var(--gold)) 3.5%, transparent); }
html.tp2 .tp2-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
html.tp2 .tp2-avwrap { position: relative; flex: 0 0 auto; }
html.tp2 .tp2-av { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; letter-spacing: .4px; color: var(--blue, var(--gold)); background: color-mix(in srgb, var(--blue, var(--gold)) 11%, transparent); flex: 0 0 auto; text-transform: uppercase; }
html.tp2 .tp2-av.lg { width: 56px; height: 56px; font-size: 17px; }
html.tp2 .tp2-av.is-invite { color: var(--amber, var(--gold)); background: color-mix(in srgb, var(--amber, var(--gold)) 13%, transparent); }
html.tp2 .tp2-av svg { width: 20px; height: 20px; }
html.tp2 .tp2-av.lg svg { width: 24px; height: 24px; }
html.tp2 .tp2-avwrap .team-presence-dot { position: absolute; right: -1px; bottom: -1px; border: 2px solid var(--bg-raised); }
html.tp2 .tp2-id { min-width: 0; }
html.tp2 .tp2-name { font-size: 15px; font-weight: 600; color: var(--white); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.tp2 .tp2-owner { margin-left: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--gold); }
html.tp2 .tp2-email { font-size: 13px; color: var(--off-white); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.tp2 .tp2-role .team-role-badge, html.tp2 .tp2-rcard .team-role-badge { padding: 5px 12px; font-size: 11px; font-weight: 700; letter-spacing: .8px; border-radius: 999px; }
html.tp2 .tp2-rolebtn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px 0 0; border: 0; background: transparent; cursor: pointer; color: var(--muted); font: inherit; }
html.tp2 .tp2-rolebtn svg { width: 16px; height: 16px; }
html.tp2 .tp2-rolebtn:hover { color: var(--white); }
html.tp2 .tp2-stat { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
html.tp2 .tp2-stat .wd-chip { margin-top: 0; }
html.tp2 .tp2-status { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--off-white); background: color-mix(in srgb, var(--off-white) 9%, transparent); white-space: nowrap; }
html.tp2 .tp2-status.is-pending { color: var(--amber, var(--gold)); background: color-mix(in srgb, var(--amber, var(--gold)) 12%, transparent); }
html.tp2 .tp2-status .tp2-live, html.tp2 .tp2-status span { color: var(--green) !important; font-weight: 700 !important; }
html.tp2 .tp2-status:has(.tp2-live), html.tp2 .tp2-status:has(span) { background: color-mix(in srgb, var(--green) 12%, transparent); }
html.tp2 .tp2-act { display: flex; justify-content: flex-end; }
html.tp2 .tp2-more { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-panel, #fff); color: var(--white); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
html.tp2 .tp2-more svg { width: 18px; height: 18px; }
html.tp2 .tp2-more:hover { border-color: var(--blue, var(--gold)); color: var(--blue, var(--gold)); }
html.tp2 .tp2-empty { padding: 34px 22px; text-align: center; color: var(--off-white); font-size: 14.5px; }
html.tp2 .tp2-link { border: 0; background: none; padding: 0; color: var(--blue, var(--gold)); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ── invite form ──────────────────────────────────────────────────── */
html.tp2 #team-invite-card { background: var(--bg-raised); padding: 22px !important; }
html.tp2 #team-invite-card > div:first-child { font-size: 12px !important; font-weight: 700 !important; letter-spacing: 1.4px; text-transform: uppercase; color: var(--white) !important; margin-bottom: 16px !important; }
html.tp2 #team-invite-card > div[style*="display:flex"] { display: grid !important; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 16px !important; align-items: end; }
html.tp2 #team-invite-card .form-group { width: auto !important; min-width: 0 !important; margin: 0 !important; }
html.tp2 #team-invite-card .form-group:nth-child(2) { width: auto !important; }
@media (min-width: 1180px) { html.tp2 #team-invite-card .form-group:nth-child(2) { min-width: max-content !important; } html.tp2 .tp2-seg.inv-kind-switch { flex-wrap: nowrap; border-radius: 999px; } html.tp2 .tp2-seg .inv-kind-tab { padding: 0 11px; } html.tp2 #team-invite-card > div[style*="display:flex"] { grid-template-columns: minmax(180px, 1fr) auto auto; gap: 12px !important; } }
html.tp2 #team-invite-card label { font-size: 11px !important; font-weight: 700 !important; letter-spacing: 1.2px !important; color: var(--white) !important; margin-bottom: 8px !important; }
html.tp2 #team-invite-card input[type="email"] { min-height: 50px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-panel, #fff); padding: 0 16px; font-size: 15px; color: var(--white); }
html.tp2 #team-invite-card input[type="email"]:focus { outline: 2px solid var(--blue, var(--gold)); border-color: transparent; }
html.tp2 #team-invite-card #team-invite-role { display: none !important; }
html.tp2 .tp2-seg.inv-kind-switch { display: flex; flex-wrap: wrap; background: var(--bg-panel, #fff); border: 1px solid var(--border); border-radius: 24px; padding: 4px; overflow: visible; width: auto; margin: 0; }
html.tp2 .tp2-seg .inv-kind-tab { min-height: 42px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 13.5px; white-space: nowrap; justify-content: center; }
html.tp2 #team-invite-card > div.tp2-flex { }
html.tp2 #team-invite-card .btn.btn-gold { min-height: 50px !important; height: auto !important; padding: 0 24px; border-radius: 12px; font-weight: 700; font-size: 14.5px; background: var(--blue, var(--gold)) !important; border-color: var(--blue, var(--gold)) !important; color: #fff !important; }
html.tp2 #team-invite-card > div:last-child { font-size: 13px !important; color: var(--off-white) !important; margin-top: 14px !important; }

/* ── archived members + seats + activity ──────────────────────────── */
html.tp2 #team-archived-list { padding: 0 !important; }
html.tp2 #page-team .team-invite-row { padding: 14px 22px; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
html.tp2 #page-team .team-invite-row:last-child { border-bottom: 0; }
html.tp2 #page-team .team-invite-row .btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-panel, #fff); font-size: 13px !important; font-weight: 600; }
html.tp2 #page-team .team-invite-row .btn[style*="--red"] { color: var(--red) !important; border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
html.tp2 #page-team #team-seats-controls button { min-width: 44px; min-height: 44px; border-radius: 50% !important; }
html.tp2 #page-team #team-seats-save { min-height: 44px; border-radius: 12px; }
html.tp2 #page-team #team-seats-display { font-family: var(--font-body) !important; font-weight: 700 !important; }
html.tp2 #page-team .team-activity-row { padding: 12px 0; font-size: 13.5px; }
html.tp2 #page-team #team-activity-card .btn { min-height: 44px; border-radius: 999px; padding: 0 18px; font-size: 13px !important; font-weight: 600; border: 1px solid var(--border); background: var(--bg-panel, #fff); }

/* ── role permissions: preset cards ───────────────────────────────── */
html.tp2 #team-role-presets { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; gap: 16px !important; }
/* 5 cards: never leave a hole on the last row. Desktop = 3 + 2 with the last card spanning the leftover slot; tablet/phone = last card full width. */
html.tp2 #team-role-presets > .team-role-preset:last-child { grid-column: 1 / -1; }
@media (min-width: 960px) { html.tp2 #team-role-presets { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } html.tp2 #team-role-presets > .team-role-preset:last-child:nth-child(3n+2) { grid-column: span 2; } html.tp2 #team-role-presets > .team-role-preset:last-child:not(:nth-child(3n+2)) { grid-column: auto; } }
@media (max-width: 640px) { html.tp2 #team-role-presets { grid-template-columns: 1fr !important; } }
html.tp2 .team-role-preset { background: var(--bg-panel, #fff) !important; border: 1px solid var(--border) !important; border-radius: 14px !important; padding: 20px !important; display: flex; flex-direction: column; gap: 10px; }
html.tp2 .team-role-preset .trp-title { font-family: inherit !important; font-size: 12px !important; font-weight: 700 !important; letter-spacing: 1.4px; text-transform: uppercase; color: var(--white); }
html.tp2 .team-role-preset .trp-sub { font-size: 13.5px; color: var(--off-white); line-height: 1.5; }
html.tp2 .team-role-preset .trp-cats { gap: 6px; }
html.tp2 .team-role-preset .trp-cat { padding: 4px 10px; font-size: 11.5px; font-weight: 600; border-radius: 999px; }
html.tp2 .team-role-preset .trp-edit { margin-top: auto; align-self: flex-start; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-raised); font-size: 13px; font-weight: 600; }
html.tp2 .team-role-preset .trp-edit:hover { border-color: var(--blue, var(--gold)); color: var(--blue, var(--gold)); }

/* ── permission pop-ups (role editor + per-person overrides): same language ── */
html.tp2 #role-perms-modal .modal, html.tp2 #member-perms-modal .modal { width: min(1000px, 94vw); max-width: 1000px; border-radius: 20px; }
html.tp2 #role-perms-modal .modal-title, html.tp2 #member-perms-modal .modal-title { font-family: var(--font-body) !important; font-size: 26px; font-weight: 700 !important; letter-spacing: -.3px; }
html.tp2 #role-perms-modal .modal-sub, html.tp2 #member-perms-modal .modal-sub { font-size: 14px; color: var(--off-white); }
html.tp2 .perm-picker-cat { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; padding: 6px 18px 10px; }
html.tp2 .perm-picker-cat-title { font-size: 12px !important; font-weight: 700 !important; letter-spacing: 1.3px; text-transform: uppercase; }
html.tp2 .perm-picker-cat-sub { font-size: 12.5px !important; color: var(--off-white); }
html.tp2 .perm-picker-cat-head .btn { min-height: 40px; border-radius: 999px; padding: 0 14px; font-size: 12.5px !important; font-weight: 600; border: 1px solid var(--border); background: var(--bg-panel, #fff); }
html.tp2 .perm-picker-row { padding: 10px 0; min-height: 48px; }
html.tp2 .perm-picker-row .ppr-label { font-size: 14px; color: var(--white); }
html.tp2 .team-perm-toggle { width: 44px !important; height: 26px !important; min-width: 44px; border-radius: 999px !important; position: relative; cursor: pointer; flex: 0 0 auto; }
html.tp2 .team-perm-toggle::after { width: 20px !important; height: 20px !important; top: 2px !important; left: 2px !important; }
html.tp2 .team-perm-toggle.on { background: var(--blue, var(--gold)) !important; border-color: var(--blue, var(--gold)) !important; }
html.tp2 .team-perm-toggle.on::after { transform: translateX(18px) !important; }
html.tp2 #role-perms-modal .modal-footer .btn, html.tp2 #member-perms-modal .modal-footer .btn { min-height: 46px; border-radius: 12px; font-weight: 600; padding: 0 22px; }
html.tp2 #role-perms-modal .modal-footer .btn-gold, html.tp2 #member-perms-modal .modal-footer .btn-gold { background: var(--blue, var(--gold)) !important; border-color: var(--blue, var(--gold)) !important; color: #fff !important; }

/* ── the row sheet ────────────────────────────────────────────────── */
html.tp2-lock { overflow: hidden; }
html.tp2 .tp2-ov { z-index: 9990; }
html.tp2 .tp2-modal { position: relative; width: min(860px, 94vw); max-width: 860px; padding: 30px 34px 28px; border-radius: 20px; max-height: 92vh; overflow-y: auto; }
html.tp2 .tp2-x { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; min-height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--off-white); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
html.tp2 .tp2-x:hover { color: var(--white); background: var(--bg-hover, rgba(0,0,0,.05)); }
html.tp2 .tp2-x svg { width: 20px; height: 20px; }
html.tp2 .tp2-sh-head { display: flex; align-items: center; gap: 18px; padding-right: 48px; margin-bottom: 24px; }
html.tp2 .tp2-sh-id { min-width: 0; }
html.tp2 .tp2-eb { font-size: 11px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; color: var(--off-white); margin-bottom: 4px; }
html.tp2 .tp2-eb-danger { color: var(--red); }
html.tp2 .tp2-sh-title { font-family: var(--font-body) !important; font-size: 28px; font-weight: 700 !important; letter-spacing: -.4px; line-height: 1.15; color: var(--white); overflow-wrap: anywhere; }
html.tp2 .tp2-sh-sub { font-size: 14px; color: var(--off-white); margin-top: 4px; overflow-wrap: anywhere; }
html.tp2 .tp2-sh-meta { font-size: 13px; color: var(--off-white); margin-top: 6px; }
html.tp2 .tp2-sh-meta b { color: var(--white); font-variant-numeric: tabular-nums; }
html.tp2 .tp2-back { width: 44px; height: 44px; min-height: 44px; flex: 0 0 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-raised); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
html.tp2 .tp2-back svg { width: 20px; height: 20px; }
html.tp2 .tp2-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
html.tp2 .tp2-acts > .tp2-act-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
html.tp2 .tp2-act-card { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; min-height: 76px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-raised); color: var(--white); font: inherit; cursor: pointer; }
html.tp2 .tp2-act-card:hover { border-color: var(--blue, var(--gold)); }
html.tp2 .tp2-act-card:focus-visible { outline: 2px solid var(--blue, var(--gold)); outline-offset: 2px; }
html.tp2 .tp2-act-ic { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--blue, var(--gold)); background: color-mix(in srgb, var(--blue, var(--gold)) 11%, transparent); }
html.tp2 .tp2-act-ic svg { width: 21px; height: 21px; }
html.tp2 .tp2-act-tx { display: grid; gap: 2px; min-width: 0; }
html.tp2 .tp2-act-t { font-size: 15px; font-weight: 700; color: var(--white); }
html.tp2 .tp2-act-x { font-size: 13px; color: var(--off-white); line-height: 1.4; }
html.tp2 .tp2-act-card.is-danger .tp2-act-t { color: var(--red); }
html.tp2 .tp2-act-card.is-danger .tp2-act-ic { color: var(--red); background: color-mix(in srgb, var(--red) 11%, transparent); }
html.tp2 .tp2-act-card.is-danger:hover { border-color: var(--red); }
html.tp2 .tp2-roles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
html.tp2 .tp2-rcard { position: relative; display: grid; gap: 8px; text-align: left; min-height: 88px; padding: 16px 48px 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-raised); color: var(--white); font: inherit; cursor: pointer; }
html.tp2 .tp2-rcard:hover { border-color: var(--blue, var(--gold)); }
html.tp2 .tp2-rcard.is-sel { border-color: var(--blue, var(--gold)); background: color-mix(in srgb, var(--blue, var(--gold)) 7%, var(--bg-raised)); }
html.tp2 .tp2-rc-x { font-size: 13.5px; color: var(--off-white); line-height: 1.45; }
html.tp2 .tp2-tick { position: absolute; right: 16px; top: 16px; width: 24px; height: 24px; color: var(--blue, var(--gold)); }
html.tp2 .tp2-tick svg { width: 22px; height: 22px; }
html.tp2 .tp2-hints { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 8px; }
html.tp2 .tp2-hints li { position: relative; padding-left: 20px; font-size: 14.5px; color: var(--off-white); line-height: 1.5; }
html.tp2 .tp2-pr-eb { margin: 4px 0 8px; }
html.tp2 .tp2-pr-list { margin-bottom: 16px; }
html.tp2 .tp2-pr-note { margin: 0 0 18px; }
html.tp2 .tp2-hints li::before { content: ''; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
html.tp2 .tp2-hints.tp2-pr-can li::before { background: var(--green, #3ba55d); }
html.tp2 .tp2-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
html.tp2 .tp2-foot .btn { min-height: 48px; padding: 0 22px; border-radius: 12px; font-weight: 600; }
html.tp2 .tp2-danger { background: var(--red) !important; border-color: var(--red) !important; color: #fff !important; }

/* ── tablets ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  html.tp2 .tp2-kpis.wf-kpi-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html.tp2 #team-invite-card > div[style*="display:flex"] { grid-template-columns: minmax(0, 1fr) auto; }
  html.tp2 #team-invite-card > div[style*="display:flex"] > .form-group:first-child { grid-column: 1 / -1; }
}

/* ── phone: slim, stacked, no sideways scroll ─────────────────────── */
@media (max-width: 720px) {
  html.tp2 #page-team #team-page-title { font-size: 30px !important; }
  /* phone: the house KPI rail - ONE sliding row of equal wide cards (icon left, label over figure), snap-scroll, page dots from the shared rail script */
  html.tp2 .tp2-kpis.wf-kpi-rail { display: flex !important; grid-template-columns: none; gap: var(--wf-kpi-gap, 10px); margin-bottom: 14px; overflow-x: auto; overflow-y: hidden; --wf-kpi-basis: calc((100% - var(--wf-kpi-gap, 10px)) / 2); --wf-kpi-cap: none; scroll-snap-type: x mandatory; scroll-padding: 0; padding-left: 0 !important; padding-right: 0 !important; }
  html.tp2 .tp2-kpis > .pay-kpi { flex: 0 0 var(--wf-kpi-basis) !important; width: var(--wf-kpi-basis) !important; min-width: var(--wf-kpi-basis) !important; max-width: var(--wf-kpi-basis) !important; grid-template-columns: auto minmax(0, 1fr); row-gap: 0; column-gap: 10px; padding: 10px 12px; border-radius: 12px; scroll-snap-align: start; box-sizing: border-box; }
  html.tp2 .tp2-kpis .wf-kpi-ic { width: 32px; height: 32px; min-width: 32px; border-radius: 9px; }
  html.tp2 .tp2-kpis .wf-kpi-ic svg { width: 16px; height: 16px; }
  html.tp2 .tp2-kpis.wf-kpi-rail .pay-kpi-label { font-size: 10px; letter-spacing: .6px !important; white-space: normal !important; line-height: 13px !important; overflow-wrap: anywhere; }
  html.tp2 .tp2-kpis.wf-kpi-rail .pay-kpi-value { font-size: 21px; line-height: 26px; }
  html.tp2 #page-team .card-header { padding: 14px 16px 12px; }
  html.tp2 .tp2-toolbar { padding: 12px 16px; gap: 10px; }
  html.tp2 .tp2-search { flex-basis: 100%; }
  html.tp2 .tp2-pills { flex-wrap: wrap; gap: 6px; }   /* chips wrap onto a second line rather than being cut at the edge */
  html.tp2 .tp2-head { display: none; }
  html.tp2 .tp2-row { grid-template-columns: 46px auto minmax(0, 1fr) 44px; grid-template-areas: "who who who act" ". role stat stat"; gap: 10px 12px; padding: 14px 16px; }
  html.tp2 .tp2-who { grid-area: who; }
  html.tp2 .tp2-act { grid-area: act; align-self: start; }
  html.tp2 .tp2-role { grid-area: role; }
  html.tp2 .tp2-stat { grid-area: stat; justify-content: flex-end; }
  html.tp2 .tp2-more span { display: none; }
  html.tp2 .tp2-more { padding: 0; width: 44px; }
  html.tp2 #team-invite-card { padding: 16px !important; }
  html.tp2 #team-invite-card > div[style*="display:flex"] { grid-template-columns: minmax(0, 1fr); gap: 14px !important; }
  html.tp2 .tp2-seg.inv-kind-switch { flex-wrap: wrap; border-radius: 18px; }
  html.tp2 .tp2-seg .inv-kind-tab { flex: 1 1 28%; padding: 0 10px; }
  html.tp2 #team-invite-card .btn.btn-gold { width: 100%; justify-content: center; }
  html.tp2 #page-team .team-invite-row { padding: 14px 16px; }
  html.tp2 #team-role-presets { grid-template-columns: minmax(0, 1fr) !important; }
  html.tp2 .tp2-ov.modal-overlay { align-items: flex-end; padding: 0; }
  html.tp2 .tp2-modal { width: 100%; max-width: 100%; padding: 22px 18px 20px; border-radius: 20px 20px 0 0; max-height: 92vh; }
  html.tp2 .tp2-sh-title { font-size: 23px; }
  html.tp2 .tp2-sh-head { gap: 14px; margin-bottom: 18px; }
  html.tp2 .tp2-acts, html.tp2 .tp2-roles-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  html.tp2 .tp2-foot { position: sticky; bottom: -20px; background: var(--bg-panel, #fff); margin: 0 -18px -20px; padding: 14px 18px 20px; flex-direction: column-reverse; }
  html.tp2 .tp2-foot .btn { width: 100%; }
  html.tp2 #role-perms-modal .modal, html.tp2 #member-perms-modal .modal { width: 100%; max-width: 100%; }
}

html.tp2 #page-team #team-activity-list { padding: 8px 22px 12px !important; }
html.tp2 .team-perm-toggle::after { background: #fff !important; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
html.tp2 .team-perm-toggle:not(.on) { background: color-mix(in srgb, var(--off-white) 30%, transparent) !important; border-color: transparent !important; }
html.tp2 .tp2-stat .wd-chip span { white-space: normal; }
@media (max-width: 720px) {
  html.tp2 .tp2-pills { gap: 6px; }
  html.tp2 .tp2-pill { padding: 0 12px; font-size: 13px; flex: 0 1 auto; }
  html.tp2 .tp2-pill-n { display: none; }
  html.tp2 #team-archived-list .team-invite-row > div:first-child { flex: 1 1 100% !important; }
  html.tp2 #team-archived-list .team-invite-row .btn { flex: 1 1 auto; justify-content: center; }
  html.tp2 .tp2-stat { min-width: 0; }
}
html.tp2 .tp2-kpis.wf-kpi-rail .pay-kpi-label { white-space: normal !important; letter-spacing: 1px !important; line-height: 1.25 !important; overflow: visible; }
html.tp2 .tp2-kpis .wf-kpi-body { min-width: 0; }
@media (max-width: 720px) { html.tp2 .tp2-kpis.wf-kpi-rail .pay-kpi-label { letter-spacing: .6px !important; } }
html.tp2 .tp2-id .wfv-tm-preset { min-height: 36px; font-size: 13px; margin-top: 2px; }
@media (max-width: 720px) { html.tp2 .tp2-id .wfv-tm-preset { min-height: 44px; } }
@media (max-width: 720px) { html.tp2 .tp2-stat .wd-chip { flex: 1 1 100%; justify-content: flex-end; border-radius: 12px; } html.tp2 .tp2-stat .wd-chip span { text-align: right; } }
/* "Shipping & locations" role preset (every team since 2026-10-19): the longer pill takes a whole row on a phone instead of clipping. */
@media (max-width: 640px) {
  html.tp2 #tp2-roles [data-preset] { flex: 1 1 100%; max-width: none; width: auto; white-space: nowrap; }
}
