/* team-page.css: the public team page (/team/<slug>) and the Team directory (/teams/directory). The layout comes from the
   shared system layer in v2.css under .sl-page (.sl-head, .tabs, .tbl with data-pri, .kv, .card, .chip, .rk, .rail, .cp,
   .btn, .sl-rail-layout, .sl-cards). Only the tp- / dir- pieces and the small shared pieces (.tm-spread, .tm-sw, .tm-acts,
   .tm-p, .chips, .chip.miss) live here, plus the share dialog and the page settings panel, which sit outside .sl-page. */

.tp, .tp-layer {
    --tp-r-sm: var(--v2-r-sm, 3px); --tp-r-md: var(--v2-r-md, 6px); --tp-r-lg: var(--v2-r-lg, 10px); --tp-r-pill: var(--v2-r-pill, 999px);
    --tp-h-sm: var(--v2-h-sm, 30px);
    --tp-fs-sm: var(--v2-fs-sm, 13px); --tp-fs-md: var(--v2-fs-md, 15px); --tp-fs-lg: var(--v2-fs-lg, 20px);
    --tp-display: var(--v2-font-display, "Saira", Bahnschrift, "Arial Narrow", system-ui, sans-serif);
    --tp-good: var(--dx-good, #4ade80);
    --rank-bronze: #cd8a4e; --rank-silver: #c3cbd6; --rank-gold: #e6b93d; --rank-platinum: #7fd4e6;
    font-family: var(--v2-font-ui, var(--font-ui, system-ui, sans-serif));
    color: var(--text);
}
.tp { display: block; min-width: 0; overflow-x: clip; }
.tp [hidden], .tp-layer [hidden] { display: none !important; }
.tp :is(button, a, select, input, textarea):focus-visible, .tp-layer :is(button, a, select, input, textarea):focus-visible { outline: none; box-shadow: var(--v2-focus, 0 0 0 3px rgba(var(--accent-rgb), .35)); }
.tp-num { font-variant-numeric: tabular-nums; }
.tp-muted { color: var(--text-3); }
.tp-note { margin: 0; color: var(--text-3); font-size: var(--fs-small); }
.tp .lmu-btn-o.tp-linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
.tp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tp-linkish { height: auto; min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--accent-soft); font: inherit; text-decoration: underline; cursor: pointer; }
.tp-linkish:hover { color: var(--text-hi); }

/* Shared with the teams page (the notes move these to v2.css later). */
.tm-spread { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-2); }
.tm-spread i { width: 9px; height: 9px; border-radius: 50%; background: var(--rk); box-shadow: 0 0 0 1px color-mix(in srgb, var(--rk) 40%, transparent); }
.tm-spread b { margin-left: 5px; font-weight: 600; color: var(--text-2); }
.tm-sw { display: inline-flex; align-items: center; gap: 8px; height: auto; min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer; font-size: 13px; color: var(--text-2); }
.tm-sw i { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-3); flex: none; }
.tm-sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-hi); transition: transform var(--v2-med, .15s) var(--v2-ease, ease); }
.tm-sw[aria-checked="true"] i { background: var(--accent); box-shadow: none; }
.tm-sw[aria-checked="true"] i::after { transform: translateX(14px); background: var(--ink); }
.tm-sw:focus-visible { outline: none; }
.tm-sw:focus-visible i { box-shadow: var(--v2-focus, 0 0 0 3px rgba(var(--accent-rgb), .35)); }
.tm-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.tm-p { margin: 0 0 6px; font-size: 12.5px; color: var(--text-3); max-width: 72ch; }
.tm-p b { color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.chip.miss { border-style: dashed; border-color: var(--warn); color: var(--warn); }
.chip .k { color: var(--text-3); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .tm-sw i::after { transition: none; } }

/* The head band. */
.tp-logo { --team: var(--info, var(--accent)); width: 52px; height: 52px; border-radius: 12px; display: inline-grid; place-items: center; flex: none; overflow: hidden; background: linear-gradient(135deg, var(--team), color-mix(in srgb, var(--team) 55%, #000)); color: #fff; font: 700 16px/1 var(--tp-display); box-shadow: 0 8px 20px -10px var(--team); }
.tp-logo.is-img { background: var(--bg-2); }
.tp-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-logo.md { width: 44px; height: 44px; border-radius: 10px; font-size: 13px; }
.tp-logo.sm { width: 28px; height: 28px; border-radius: 7px; font-size: 10px; }
.tp-tag { font: 700 13px var(--tp-display); letter-spacing: .08em; color: var(--text-3); padding: 2px 8px; border: 1px solid var(--line-2); border-radius: var(--tp-r-pill); vertical-align: middle; }
.sl-head .sub .sep { color: var(--text-4, var(--text-3)); margin: 0 6px; }
.sl-head .sub b { color: var(--text-hi); font-weight: 650; }
.tp-reqedit { margin-left: 8px; font-size: var(--fs-small); font-weight: 600; }

/* Tab bodies. */
.tp-body { min-width: 0; }
.tp-vis { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.tp-hidden-note { margin: 0 0 var(--s3); padding: 10px 14px; border: 1px dashed var(--line-3); border-radius: var(--tp-r-md); color: var(--text-3); font-size: var(--tp-fs-sm); }
.tp-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tp-who { display: flex; align-items: center; gap: 8px; white-space: normal; }
.tp-who small { display: block; font-size: 11px; color: var(--text-3); }
.tp-av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-hi); font: 700 10px var(--tp-display); object-fit: cover; }
.tp-flag { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); border: 1px solid var(--line-3); border-radius: var(--tp-r-sm); padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
.tp-pos { display: inline-grid; place-items: center; min-width: 32px; height: 22px; padding: 0 6px; border-radius: 5px; font: 700 12px var(--tp-display); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-hi); }
.tp-pos.win { background: color-mix(in srgb, var(--rank-gold) 24%, var(--bg-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rank-gold) 65%, transparent); }
.tp-pos.pod { background: color-mix(in srgb, var(--tp-good) 16%, var(--bg-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tp-good) 50%, transparent); }
.tp-pw { margin-left: 6px; font-size: 11px; color: var(--text-3); }
.tp-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 8px 0 0; font-size: 13px; }
.tp-kv dt { color: var(--text-3); }
.tp-kv dd { margin: 0; color: var(--text-2); }
.tp-prose { margin: 0; font-size: 14px; color: var(--text-2); max-width: 72ch; overflow-wrap: anywhere; }
.tp-hl { border-left: 3px solid var(--rank-gold); overflow-wrap: anywhere; }
.tp-hl .w { font: 700 10px var(--tp-display); letter-spacing: var(--caps, .08em); text-transform: uppercase; color: var(--text-3); }
.tp-hl b { display: block; font: 650 16px/1.2 var(--tp-display); color: var(--text-hi); margin: 2px 0; }
.tp-hl p { margin: 0; font-size: 12px; color: var(--text-3); }
.tp-seat { display: grid; gap: 8px; align-content: start; overflow-wrap: anywhere; }
.tp-seat h3 { margin: 0 0 2px; font: 650 16px var(--tp-display); color: var(--text-hi); }
.tp-seat .w { font: 700 10px var(--tp-display); letter-spacing: var(--caps, .08em); text-transform: uppercase; color: var(--text-3); }
.tp-seat p { margin: 0; font-size: var(--tp-fs-sm); color: var(--text-2); }
.tp-month { display: inline-flex; align-items: center; gap: 8px; }
.tp-month select { width: auto; min-height: 0; height: var(--tp-h-sm); padding: 0 10px; border: 1px solid var(--line-3); border-radius: var(--tp-r-md); background: var(--bg-2); color: var(--text); font-size: var(--fs-small); font-weight: 600; text-transform: none; letter-spacing: 0; }
.tp-sponsors { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-pin[aria-pressed="true"] { color: var(--accent-soft); }
.tp-og-mini { --team: var(--info, var(--accent)); aspect-ratio: 1200 / 630; border-radius: var(--tp-r-md); border: 1px solid var(--line-2); background: linear-gradient(135deg, color-mix(in srgb, var(--team) 22%, var(--bg)), var(--bg) 70%); padding: 10px 12px; display: grid; grid-template-rows: auto 1fr auto; font-size: 11px; color: var(--text-3); overflow: hidden; }
.tp-og-mini .n { display: flex; align-items: center; gap: 8px; align-self: center; font: 650 15px var(--tp-display); color: var(--text-hi); min-width: 0; }

/* Directory. */
.dir-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 1px 12px; align-items: center; color: inherit; text-decoration: none; }
.dir-card:hover { text-decoration: none; }
.dir-card .n { font: 650 14px/1.2 var(--tp-display); color: var(--text-hi); overflow-wrap: anywhere; }
.dir-card .n .tp-tag { font-size: 11px; padding: 0 6px; margin-left: 6px; }
.dir-card .f { font-size: 12px; color: var(--text-3); grid-column: 2; }
a.card.lift.dir-card:focus-visible { outline: none; box-shadow: var(--v2-focus, 0 0 0 3px rgba(var(--accent-rgb), .35)); }

/* Share dialog and the card preview (drawn at 600 x 315, half of the 1200 x 630 PNG, scaled to fit). */
.tp-btn, .tp-btn-q { height: var(--tp-h-sm); min-height: 0; margin: 0; box-shadow: none; transform: none; border-radius: var(--tp-r-md); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1; }
.tp-btn { padding: 0 12px; border: 1px solid var(--line-3); background: var(--bg-2); color: var(--text); }
.tp-btn:hover { border-color: var(--accent); color: var(--text-hi); }
.tp-btn-p { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 700; }
.tp-btn-p:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--ink); }
.tp-btn-q { padding: 0 10px; border: 1px solid transparent; background: none; color: var(--text-2); }
.tp-btn-q:hover { color: var(--text-hi); background: var(--v2-hover, color-mix(in srgb, var(--text) 6%, transparent)); border-color: transparent; }
.tp-btn:disabled, .tp-btn-p:disabled { opacity: .55; cursor: not-allowed; }
.tp-btn:active, .tp-btn-q:active { transform: none; }
.tp-dlg { border: 1px solid var(--line-3); border-radius: var(--tp-r-lg); background: var(--panel-2); color: var(--text); padding: 0; width: min(680px, calc(100vw - 32px)); max-width: min(680px, calc(100vw - 32px)); }
.tp-dlg::backdrop { background: rgba(0, 0, 0, .6); }
.tp-dlg-body { padding: 18px; display: grid; gap: 12px; min-width: 0; }
.tp-dlg-body h2 { margin: 0; font: 600 var(--tp-fs-lg)/1.2 var(--tp-display); color: var(--text-hi); overflow-wrap: anywhere; }
.tp-dlg-body > .tp-acts { justify-content: flex-end; }
.tp-linkrow { display: flex; gap: 8px; min-width: 0; }
.tp-linkrow input { flex: 1; min-width: 0; width: auto; min-height: 0; height: var(--tp-h-sm); padding: 0 10px; border: 1px solid var(--line-3); border-radius: var(--tp-r-md); background: var(--bg-2); color: var(--text); font-size: var(--fs-small); }
.tp-ogwrap { width: 100%; aspect-ratio: 1200 / 630; position: relative; overflow: hidden; border-radius: var(--tp-r-md); border: 1px solid var(--line-3); }
.tp-og { position: absolute; left: 0; top: 0; width: 600px; height: 315px; transform-origin: 0 0; padding: 26px 28px; display: grid; grid-template-rows: auto 1fr auto; background: radial-gradient(120% 90% at 100% 0%, var(--panel-2) 0%, var(--panel) 55%, var(--bg) 100%); color: var(--text); }
.tp-brand { display: flex; justify-content: space-between; align-items: center; font: 700 12px/1 var(--tp-display); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tp-brand b { color: var(--text-hi); } .tp-brand b i { color: var(--accent); font-style: normal; }
.tp-mid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; min-width: 0; }
.tp-og .tp-logo { width: 64px; height: 64px; font-size: 22px; border-radius: 10px; }
.tp-og h2 { margin: 0; font: 600 30px/1.05 var(--tp-display); color: var(--text-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-l1 { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.tp-l1 b { color: var(--text-hi); }
.tp-dot { color: var(--text-3); margin: 0 5px; }
.tp-ognums { display: flex; gap: 22px; margin-top: 10px; }
.tp-ognums b { display: block; font: 600 26px/1 var(--tp-display); color: var(--text-hi); }
.tp-ognums span { color: var(--text-3); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.tp-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; font-size: 11px; color: var(--text-3); }
.tp-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.tp-pill { height: 18px; padding: 0 7px; border-radius: var(--tp-r-pill); border: 1px solid color-mix(in srgb, var(--rk) 60%, var(--line-3)); background: color-mix(in srgb, var(--rk) 14%, var(--bg-2)); color: var(--text-hi); font-size: 10px; font-weight: 700; display: inline-grid; place-items: center; }
.tp-layer [data-rk="Bronze"] { --rk: var(--rank-bronze); }
.tp-layer [data-rk="Silver"] { --rk: var(--rank-silver); }
.tp-layer [data-rk="Gold"] { --rk: var(--rank-gold); }
.tp-layer [data-rk="Platinum"] { --rk: var(--rank-platinum); }

/* Page settings: a side panel (a bottom sheet under 720px). */
.tp-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001; width: min(400px, 100vw); overflow: auto; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); border-left: 1px solid var(--line-3); background: var(--panel-2); box-shadow: -20px 0 60px rgba(0, 0, 0, .6); display: grid; gap: 14px; align-content: start; }
.tp-scrim { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .45); }
.tp-panel h2 { margin: 0; font: 600 var(--tp-fs-lg)/1.2 var(--tp-display); color: var(--text-hi); display: flex; justify-content: space-between; align-items: center; }
.tp-panel h3 { margin: 6px 0 0; font-size: var(--fs-micro); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: var(--tp-fs-sm); cursor: pointer; }
.tp-row:last-of-type { border-bottom: 0; }
.tp-row small { display: block; color: var(--text-3); font-size: var(--fs-small); }
.tp-field { display: grid; gap: 4px; font-size: var(--fs-small); color: var(--text-2); min-width: 0; }
.tp-panel input[type="text"], .tp-panel input[type="url"], .tp-panel textarea { width: 100%; min-height: 0; margin: 0; padding: 6px 10px; border: 1px solid var(--line-3); border-radius: var(--tp-r-md); background: var(--bg-2); color: var(--text); font: inherit; font-size: var(--tp-fs-sm); }
.tp-panel textarea { min-height: 72px; resize: vertical; }
.tp-panel textarea.tp-short { min-height: 60px; }
.tp-cnt { text-align: right; color: var(--text-3); font-size: var(--fs-micro); }
.tp-cnt.tp-left { text-align: left; margin-top: 4px; }
.tp-err { color: var(--crit); font-size: var(--fs-small); }
.tp-err:empty { display: none; }
.tp-formerr { margin: 0; }
.tp-pacts { display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0; padding-top: 10px; background: var(--panel-2); }
.tp-acts-l { justify-content: flex-start; }
.tp-sw { position: relative; width: 36px; height: 20px; flex: none; }
.tp-sw input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; opacity: 0; margin: 0; cursor: pointer; }
.tp-sw i { position: absolute; inset: 0; border-radius: var(--tp-r-pill); background: var(--surface-3); border: 1px solid var(--line-3); transition: background .15s; }
.tp-sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .15s; }
.tp-sw input:checked + i { background: color-mix(in srgb, var(--tp-good) 35%, var(--surface-3)); border-color: var(--tp-good); }
.tp-sw input:checked + i::after { transform: translateX(16px); background: var(--text-hi); }
.tp-sw input:focus-visible + i { box-shadow: var(--v2-focus, 0 0 0 3px rgba(var(--accent-rgb), .35)); }
.tp-logo-row { display: flex; align-items: center; gap: 12px; }
.tp-logo.tp-logo-sm { width: 56px; height: 56px; font-size: 20px; border-radius: 10px; }
@media (max-width: 720px) {
    .tp-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 86vh; border-left: 0; border-top: 1px solid var(--line-3); border-radius: 14px 14px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .7); }
    /* 16px stops iOS from zooming into a field. */
    .tp-panel input[type="text"], .tp-panel input[type="url"], .tp-panel textarea { font-size: 16px; }
    .dir-card { grid-template-columns: 44px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .tp-sw i, .tp-sw i::after { transition: none; } }
.tp-layer .empty { padding: 12px; border: 1px dashed var(--line-3); border-radius: var(--tp-r-md); background: var(--bg-2); color: var(--text-3); font-size: var(--tp-fs-sm); }
.tp-layer .empty b { display: block; color: var(--text-hi); margin-bottom: 2px; }
.tp-layer .empty.err { border-color: color-mix(in srgb, var(--crit) 40%, var(--line-3)); }
