/* Tactivela components v0.6 (Exploration). v0.6: icons without tiles, fine line icons, tool names under icons.
   Load order: fonts.css, tokens.css, tactivela.css. Every colour comes from a --tk-* token,
   so each component works in the night kit and the day kit without extra rules.
   v0.5: every screen rotates -- the side safe areas and the compact app bar, "Held sideways" at the end.
   v0.4: phone first, and now tablets and PCs too -- see "Larger screens" at the end.
   v0.3: every piece of chrome has rounded corners from the --tk-radius-* tokens, with 2px borders.
   Full-width bars (app bar, hero, control bar, tabs, bench strip, nav) stay edge to edge.
   The .tk-* class prefix: named after the app's first name, TactiKit; kept so nothing already saved on a device is lost. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--tk-bg);
  color: var(--tk-text);
  font-family: var(--tk-font-body);
  font-size: var(--tk-fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--tk-violet); }
:focus-visible { outline: 2px solid var(--tk-violet); outline-offset: 2px; }
.tk-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Icons from the inline sprite: <svg class="tk-icon"><use href="#tk-ui-share"/></svg> */
.tk-icon {
  width: 24px; height: 24px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: var(--tk-icon-stroke); stroke-linecap: round; stroke-linejoin: round;
}
.tk-icon--sm { width: 18px; height: 18px; }
.tk-icon--md { width: 20px; height: 20px; }
.tk-icon--sm, .tk-icon--md { stroke-width: var(--tk-icon-stroke-small); }
.tk-icon--lg { width: 28px; height: 28px; }
.tk-token { width: 24px; height: 24px; flex-shrink: 0; }

/* ---------- Type ---------- */
.tk-display, .tk-title, .tk-h2, .tk-h3, .tk-label, .tk-section-label, .tk-eyebrow, .tk-num {
  font-family: var(--tk-font-display);
}
.tk-title { font-size: var(--tk-fs-title); font-weight: 800; line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; margin: 0; }
.tk-h2 { font-size: var(--tk-fs-h2); font-weight: 800; line-height: 1; letter-spacing: var(--tk-track-title); text-transform: uppercase; margin: 0; }
.tk-h3 { font-size: var(--tk-fs-h3); font-weight: 700; line-height: 1.1; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; }
.tk-eyebrow { font-size: var(--tk-fs-label); font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--tk-violet); }
.tk-section-label { font-size: 13px; font-weight: 700; letter-spacing: var(--tk-track-label); text-transform: uppercase; color: var(--tk-text-subtle); margin: 0; }
.tk-meta { font-size: var(--tk-fs-meta); color: var(--tk-text-subtle); }
.tk-muted { color: var(--tk-text-muted); }
.tk-num { font-weight: 900; font-variant-numeric: tabular-nums; }
.tk-wordmark { font-family: var(--tk-font-display); font-weight: 800; line-height: 0.9; letter-spacing: 0.01em; }
.tk-wordmark b { font-weight: 800; color: var(--tk-wordmark-kit); }

/* ---------- Screen shell ---------- */
.tk-screen { display: flex; flex-direction: column; min-height: 100%; background: var(--tk-bg);
  padding-left: var(--tk-safe-left); padding-right: var(--tk-safe-right); }   /* the notch of a phone held sideways: "Held sideways" */
.tk-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--tk-space-5); display: flex; flex-direction: column; gap: var(--tk-space-3); }

/* App bar with the yellow touchline and the skewed streak */
.tk-appbar {
  position: relative; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; gap: var(--tk-space-2);
  min-height: calc(var(--tk-appbar-h) + var(--tk-safe-top));
  padding: var(--tk-safe-top) var(--tk-space-3) 0 var(--tk-space-1);
  background: var(--tk-surface);
  border-bottom: var(--tk-touchline-width) solid var(--tk-touchline);
}
.tk-appbar::before {
  content: ""; position: absolute; top: -40px; left: -30px; width: 90px; height: 170px;
  background: var(--tk-streak); opacity: var(--tk-streak-opacity); transform: skewX(-18deg); pointer-events: none;
}
.tk-appbar > * { position: relative; }
.tk-appbar__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tk-appbar__eyebrow { font-family: var(--tk-font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--tk-violet); }
.tk-appbar__title { font-family: var(--tk-font-display); font-size: var(--tk-fs-h2); font-weight: 800; line-height: 1; text-transform: uppercase; letter-spacing: var(--tk-track-title); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-appbar__sub { font-family: var(--tk-font-display); font-size: var(--tk-fs-label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tk-now); }
.tk-appbar__actions { display: flex; gap: var(--tk-space-2); }

/* Hero header used on the main menu */
.tk-hero { position: relative; overflow: hidden; background: var(--tk-surface); border-bottom: var(--tk-touchline-width) solid var(--tk-touchline); padding: calc(var(--tk-safe-top) + 24px) 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.tk-hero::before { content: ""; position: absolute; top: -60px; left: -40px; width: 140px; height: 260px; background: var(--tk-streak); opacity: var(--tk-streak-opacity); transform: skewX(-18deg); }
.tk-hero > * { position: relative; }

/* Control row under the app bar */
.tk-controlbar { flex-shrink: 0; display: flex; align-items: center; gap: var(--tk-space-2); padding: 8px 12px; background: var(--tk-surface); border-bottom: 1px solid var(--tk-line); }

/* Bottom navigation */
.tk-nav { flex-shrink: 0; display: grid; grid-template-columns: repeat(var(--tk-nav-cols, 5), minmax(0, 1fr)); background: var(--tk-nav); border-top: var(--tk-border) solid var(--tk-line); padding-bottom: var(--tk-safe-bottom); }
.tk-nav__item {
  position: relative; min-height: var(--tk-nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: none; border: 0; cursor: pointer; color: var(--tk-text-subtle); text-decoration: none;
  font-family: var(--tk-font-display); font-size: var(--tk-fs-label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.tk-nav__item[aria-current="page"] { color: var(--tk-now); }
.tk-nav__item[aria-current="page"]::before { content: ""; position: absolute; top: -2px; left: 25%; right: 25%; height: 3px; background: var(--tk-touchline); border-radius: 0 0 3px 3px; }

/* ---------- Buttons ---------- */
.tk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tk-touch); padding: 0 16px; border: var(--tk-border) solid var(--tk-field-line); border-radius: var(--tk-radius);
  background: var(--tk-card); color: var(--tk-text); cursor: pointer; text-decoration: none;
  font-family: var(--tk-font-display); font-size: 15px; font-weight: 700; letter-spacing: var(--tk-track-button); text-transform: uppercase;
  transition: filter var(--tk-dur) var(--tk-ease), transform var(--tk-dur-fast) var(--tk-ease), border-color var(--tk-dur) var(--tk-ease);
}
.tk-btn:active { transform: scale(0.97); }
.tk-btn:disabled, .tk-btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; transform: none; }
.tk-btn--primary { background: var(--tk-purple); color: var(--tk-on-accent); border-color: var(--tk-violet); }
.tk-btn--primary:hover { filter: brightness(1.08); }
.tk-btn--secondary { background: transparent; color: var(--tk-violet-soft); border-color: var(--tk-violet); }
.tk-btn--pro { background: var(--tk-touchline); color: var(--tk-on-touchline); border-color: var(--tk-touchline); font-weight: 800; }
.tk-btn--danger { background: transparent; color: var(--tk-bad-text); border-color: var(--tk-bad); }
.tk-btn--lg { min-height: var(--tk-btn-h); font-size: 17px; }
.tk-btn--sm { min-height: 36px; padding: 0 10px; font-size: 13px; }
.tk-btn--block { display: flex; width: 100%; }
.tk-btn--icon { width: var(--tk-touch); padding: 0; }
.tk-btn--icon.tk-btn--primary { color: var(--tk-on-accent); }
.tk-btn--now { color: var(--tk-now); }

/* ---------- Form fields ---------- */
.tk-field { display: flex; flex-direction: column; gap: 6px; }
.tk-field__label { font-family: var(--tk-font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tk-text-muted); }
.tk-input, .tk-select, .tk-textarea {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: var(--tk-radius);
  background: var(--tk-card); color: var(--tk-text); border: var(--tk-border) solid var(--tk-field-line);
  font-family: var(--tk-font-body); font-size: var(--tk-fs-body); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color var(--tk-dur) var(--tk-ease), box-shadow var(--tk-dur) var(--tk-ease);
}
.tk-textarea { padding: 10px 14px; min-height: 84px; resize: vertical; line-height: 1.45; }
.tk-input::placeholder, .tk-textarea::placeholder { color: var(--tk-text-subtle); }
.tk-input:focus, .tk-select:focus, .tk-textarea:focus { border-color: var(--tk-violet); box-shadow: 0 0 0 3px var(--tk-focus-ring); }
.tk-field:focus-within .tk-field__label { color: var(--tk-violet); }
.tk-select { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 14px) 20px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }

/* Segmented control: one choice from two to four */
.tk-seg { display: grid; flex-shrink: 0; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; border: var(--tk-border) solid var(--tk-line); border-radius: var(--tk-radius); }
.tk-seg > button:first-child { border-radius: calc(var(--tk-radius) - 2px) 0 0 calc(var(--tk-radius) - 2px); }
.tk-seg > button:last-child { border-radius: 0 calc(var(--tk-radius) - 2px) calc(var(--tk-radius) - 2px) 0; }
.tk-seg > button {
  min-height: 40px; border: 0; background: var(--tk-card); color: var(--tk-text-muted); cursor: pointer;
  font-family: var(--tk-font-display); font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.tk-seg > button[aria-pressed="true"] { background: var(--tk-touchline); color: var(--tk-on-touchline); font-weight: 800; }

/* Chips: formation picker, filters */
.tk-chip {
  min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--tk-card); color: var(--tk-text-muted); border: var(--tk-border) solid var(--tk-line); border-radius: var(--tk-radius);
  font-family: var(--tk-font-display); font-size: 16px; font-weight: 800; letter-spacing: 0.04em;
}
.tk-chip[aria-pressed="true"], .tk-chip--current { color: var(--tk-now); border-color: var(--tk-now); }

/* Drawing tools and colour swatches */
.tk-tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tk-tool {
  min-height: var(--tk-touch); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 4px 2px 7px; cursor: pointer;
  background: none; border: 0; border-radius: var(--tk-radius); color: var(--tk-text-muted);
  font-family: var(--tk-font-display); font-size: var(--tk-fs-micro); font-weight: 600; line-height: 1.1; letter-spacing: 0.02em; text-align: center;
}
.tk-tool .tk-icon { width: var(--tk-icon-tool); height: var(--tk-icon-tool); stroke-width: var(--tk-icon-stroke); }
.tk-tool[aria-pressed="true"] { color: var(--tk-now); font-weight: 800; background: linear-gradient(var(--tk-touchline), var(--tk-touchline)) center bottom / 18px 3px no-repeat; }
.tk-swatches { display: flex; gap: 8px; align-items: center; }
.tk-swatch { width: 26px; height: 26px; border: 0; padding: 0; cursor: pointer; border-radius: var(--tk-radius-sm); box-shadow: inset 0 0 0 1px var(--tk-line); }
.tk-swatch[aria-pressed="true"] { outline: 2px solid var(--tk-text); outline-offset: 2px; }

/* ---------- Tags and badges ---------- */
.tk-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; white-space: nowrap;
  border: var(--tk-hairline) solid currentColor; border-radius: var(--tk-radius-sm); color: var(--tk-text-muted); background: transparent;
  font-family: var(--tk-font-display); font-size: var(--tk-fs-label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.tk-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tk-tag--plain::before { display: none; }
.tk-tag--ok { color: var(--tk-ok); background: var(--tk-ok-tint); }
.tk-tag--warn { color: var(--tk-warn); background: var(--tk-warn-tint); }
.tk-tag--bad { color: var(--tk-bad-text); background: var(--tk-bad-tint); }
.tk-tag--na { color: var(--tk-na); background: var(--tk-na-tint); }
.tk-tag--now, .tk-tag--match { color: var(--tk-now); background: var(--tk-now-tint); }
.tk-tag--violet, .tk-tag--training { color: var(--tk-violet-soft); background: var(--tk-violet-tint); }   /* 4.5:1 or more in both kits (0.7.2) */
.tk-tag--recovery { color: var(--tk-ok); background: var(--tk-ok-tint); }
.tk-tag--info { color: var(--tk-info); }
.tk-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--tk-radius-sm);
  background: var(--tk-touchline); color: var(--tk-on-touchline);
  font-family: var(--tk-font-display); font-size: var(--tk-fs-label); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ---------- Cards and rows ---------- */
.tk-card { background: var(--tk-card); border: var(--tk-border) solid var(--tk-line); border-radius: var(--tk-radius); padding: var(--tk-space-4); }
.tk-panel { background: var(--tk-surface); border: var(--tk-border) solid var(--tk-line); border-radius: var(--tk-radius-lg); padding: var(--tk-space-4); }
/* v0.6: icons no longer sit in a filled tile. The class stays so the markup does not change. */
.tk-tile { width: 48px; height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: none; color: var(--tk-violet-soft); }
.tk-tile .tk-icon { width: var(--tk-icon-mode); height: var(--tk-icon-mode); stroke-width: var(--tk-icon-stroke); }
.tk-tile--primary { background: none; }

.tk-mode-card {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; text-decoration: none;
  background: var(--tk-card); color: var(--tk-text); border: var(--tk-border) solid var(--tk-line); border-radius: var(--tk-radius-lg);
  transition: border-color var(--tk-dur) var(--tk-ease), background var(--tk-dur) var(--tk-ease);
}
.tk-mode-card:hover { border-color: var(--tk-violet); }
.tk-mode-card:active { background: var(--tk-card-raised); }
.tk-mode-card--current { border-color: var(--tk-violet); }
.tk-mode-card--current::before { content: ""; position: absolute; top: -2px; left: 18px; width: 32px; height: 4px; border-radius: 0 0 4px 4px; background: var(--tk-touchline); }
.tk-mode-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tk-mode-card__title { display: flex; align-items: center; gap: 8px; font-family: var(--tk-font-display); font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: var(--tk-track-title); text-transform: uppercase; }
.tk-mode-card__desc { font-size: var(--tk-fs-body-s); line-height: 1.4; color: var(--tk-text-muted); }
.tk-mode-card__meta { font-family: var(--tk-font-display); font-size: var(--tk-fs-label); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tk-violet); }
.tk-mode-card__chev { color: var(--tk-text-subtle); }
.tk-mode-card--current .tk-mode-card__chev { color: var(--tk-now); }

.tk-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 12px; background: var(--tk-card); border: var(--tk-hairline) solid var(--tk-line); border-radius: var(--tk-radius); }
.tk-row__num { width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--tk-radius-sm); background: var(--tk-tile); color: var(--tk-on-accent); font-family: var(--tk-font-display); font-size: 18px; font-weight: 800; }
.tk-row__name { flex: 1; min-width: 0; font-family: var(--tk-font-display); font-size: 18px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tk-stat { background: var(--tk-card); border: var(--tk-hairline) solid var(--tk-line); border-radius: var(--tk-radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tk-stat__label { font-family: var(--tk-font-display); font-size: var(--tk-fs-label); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tk-text-subtle); }
.tk-stat__value { font-family: var(--tk-font-display); font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tk-stat__note { font-size: var(--tk-fs-label); color: var(--tk-text-muted); }

.tk-empty { text-align: center; padding: 44px 16px; color: var(--tk-text-muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tk-empty .tk-icon { width: 40px; height: 40px; color: var(--tk-text-subtle); }
.tk-empty__title { font-family: var(--tk-font-display); font-size: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tk-text); }

/* RPE scale: tap how hard the session felt, 1 to 10. Two rows of five, so every button is 44 px or more
   each way on every screen (ten in a row are narrower than that even in a tablet's 480 px sheet). */
.tk-rpe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--tk-space-1); }
.tk-rpe > button { min-height: var(--tk-touch); border: var(--tk-hairline) solid var(--tk-line); border-radius: var(--tk-radius-sm); background: var(--tk-card); color: var(--tk-text-muted); cursor: pointer; font-family: var(--tk-font-display); font-size: 15px; font-weight: 700; }
.tk-rpe > button[aria-pressed="true"][data-zone="1"] { background: var(--tk-rpe-easy); border-color: var(--tk-rpe-easy); color: #07060C; }
.tk-rpe > button[aria-pressed="true"][data-zone="2"] { background: var(--tk-rpe-moderate); border-color: var(--tk-rpe-moderate); color: #07060C; }
.tk-rpe > button[aria-pressed="true"][data-zone="3"] { background: var(--tk-rpe-hard); border-color: var(--tk-rpe-hard); color: #07060C; }
.tk-rpe > button[aria-pressed="true"][data-zone="4"] { background: var(--tk-rpe-max); border-color: var(--tk-rpe-max); color: #FFFFFF; }
.tk-zone--low { color: var(--tk-info); } .tk-zone--ok { color: var(--tk-ok); } .tk-zone--watch { color: var(--tk-warn); }
.tk-zone--high { color: var(--tk-bad-text); } .tk-zone--na { color: var(--tk-text-subtle); }

/* ---------- Sheets, toasts, FAB ---------- */
.tk-scrim { position: fixed; inset: 0; background: var(--tk-scrim); display: flex; align-items: flex-end; justify-content: center; z-index: var(--tk-z-sheet);
  padding-left: var(--tk-safe-left); padding-right: var(--tk-safe-right); }
.tk-sheet {
  width: 100%; max-width: 480px; max-height: 91vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  background: var(--tk-surface); border: var(--tk-border) solid var(--tk-line); border-bottom: 0; border-radius: var(--tk-radius-lg) var(--tk-radius-lg) 0 0; box-shadow: var(--tk-shadow-sheet);
  padding: 16px 16px calc(16px + var(--tk-safe-bottom));
}
.tk-sheet__head { display: flex; align-items: center; gap: 8px; }
.tk-sheet__title { flex: 1; font-family: var(--tk-font-display); font-size: 20px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; margin: 0; }
.tk-toast {
  position: fixed; left: calc(50% + (var(--tk-safe-left) - var(--tk-safe-right)) / 2); bottom: calc(76px + var(--tk-safe-bottom)); transform: translateX(-50%); z-index: var(--tk-z-toast);
  background: var(--tk-surface); color: var(--tk-text); border: var(--tk-border) solid var(--tk-violet); border-radius: var(--tk-radius-pill); padding: 10px 18px;
  font-family: var(--tk-font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.tk-fab { position: fixed; right: calc(16px + var(--tk-safe-right)); bottom: calc(76px + var(--tk-safe-bottom)); width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: var(--tk-radius-lg); background: var(--tk-purple); color: var(--tk-on-accent); border: var(--tk-border) solid var(--tk-violet); cursor: pointer; }

/* ---------- Pitch, jerseys, discs ---------- */
.tk-pitch {
  position: relative; background-color: var(--tk-pitch);
  background-image: repeating-linear-gradient(0deg, var(--tk-pitch-stripe) 0 29px, rgba(0, 0, 0, 0.08) 29px 58px);
  border: 3px solid var(--tk-pitch-edge); border-radius: var(--tk-radius); box-shadow: 0 0 0 1px var(--tk-line);
}
.tk-pitch--afl { background-color: var(--tk-surface-afl); }
.tk-pitch--court { background-color: var(--tk-surface-court); }
.tk-pitch--netball { background-color: var(--tk-surface-netball); }
.tk-pitch--ice { background-color: var(--tk-surface-ice); }
.tk-pitch__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tk-pitch__lines * { vector-effect: non-scaling-stroke; }

/* Jersey slot on the formation builder. Set the kit with --kit-fill and --kit-edge (from the club's jersey preset). */
.tk-slot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tk-jersey { position: relative; width: 44px; height: 44px; --kit-fill: var(--j2, var(--tk-purple)); --kit-edge: var(--jb, #C9A6FF); --kit-num: #FFFFFF; }
.tk-jersey svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tk-jersey path { fill: var(--kit-fill); stroke: var(--kit-edge); stroke-width: 1; stroke-linejoin: round; }
.tk-jersey__num { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-family: var(--tk-font-display); font-size: 17px; font-weight: 900; line-height: 1; color: var(--kit-num); }
.tk-jersey--keeper { --kit-fill: var(--tk-keeper); --kit-edge: var(--tk-keeper-edge); --kit-num: #07060C; }
.tk-jersey--opp { --kit-fill: var(--tk-opponent); --kit-edge: var(--tk-opponent-edge); }
.tk-jersey--empty path { fill: rgba(255, 255, 255, 0.06); stroke: rgba(255, 255, 255, 0.55); stroke-dasharray: 1.5 1.2; }
.tk-jersey--empty .tk-jersey__num { color: rgba(255, 255, 255, 0.72); font-size: 13px; top: 36%; }
.tk-jersey--target path { fill: rgba(164, 91, 255, 0.35); stroke: var(--tk-touchline); }
.tk-slot.is-dragging .tk-jersey { filter: drop-shadow(var(--tk-shadow-drag)); }
.tk-nametag {
  background: var(--tk-nametag); color: #FFFFFF; border: 1px solid var(--tag-edge, var(--tk-touchline)); border-radius: var(--tk-radius-sm); padding: 1px 5px; white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--tk-font-display); font-size: var(--tk-fs-micro); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.tk-nametag--keeper { --tag-edge: var(--tk-keeper-edge); }
.tk-nametag--opp { --tag-edge: var(--tk-opponent-edge); color: var(--tk-opponent-edge); }

/* Tactics board discs */
.tk-disc { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--tk-font-display); font-size: 16px; font-weight: 900; color: #FFFFFF; background: var(--kit-fill, var(--tk-purple)); border: 2px solid var(--kit-edge, #C9A6FF); box-shadow: 0 0 0 1px rgba(11, 8, 18, 0.55); }
.tk-disc--keeper { background: var(--tk-keeper); border-color: var(--tk-keeper-edge); color: #07060C; }
.tk-disc--opp { background: #07060C; border-color: var(--tk-opponent); color: #FF8A8A; }
.tk-disc.is-selected { outline: 2px solid var(--tk-touchline); outline-offset: 2px; }

/* Bench strip */
.tk-bench { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 70px; background: var(--tk-surface); border-top: 1px solid var(--tk-line); overflow-x: auto; }
.tk-bench__item { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 4px; background: var(--tk-card); border: 1px solid var(--tk-line); border-radius: var(--tk-radius); flex-shrink: 0; }
.tk-bench__slot { height: 44px; min-width: 88px; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--tk-now-dim); border-radius: var(--tk-radius); color: var(--tk-text-subtle); font-family: var(--tk-font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Kit-aware helpers (data-resolved-theme is set by js/tk-theme.js) ---------- */
:root[data-resolved-theme="light"] .tk-when-dark { display: none !important; }
:root:not([data-resolved-theme="light"]) .tk-when-light { display: none !important; }
.tk-crest { width: 60px; height: 60px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--tk-radius); background: var(--tk-card); border: 2px dashed var(--tk-line-strong); color: var(--tk-text-subtle); font-family: var(--tk-font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; overflow: hidden; }
.tk-crest img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Tabs (squad, sessions, training load) ---------- */
.tk-tabs { display: flex; flex-shrink: 0; background: var(--tk-surface); border-bottom: var(--tk-border) solid var(--tk-line); }
.tk-tab {
  flex: 1; min-height: 44px; padding: 0 4px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; cursor: pointer;
  color: var(--tk-text-subtle); font-family: var(--tk-font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
}
.tk-tab[aria-selected="true"] { color: var(--tk-now); border-bottom-color: var(--tk-touchline); }

/* Current team card, settings rows, player photo */
.tk-card--current { border-color: var(--tk-now); }
.tk-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; border-bottom: var(--tk-hairline) solid var(--tk-line); }
.tk-setting:last-child { border-bottom: 0; }
.tk-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--tk-card-raised); border: 2px solid var(--tk-line); color: var(--tk-text-subtle); }
.tk-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Larger screens: tablets (700px and up) and PCs (1100px and up) ----------
   Phone first. On a tablet the bottom navigation becomes a rail down the left (add
   tk-nav--rail; the screen puts it in a left column), sheets open as centred dialogs,
   and reading content sits in a column (.tk-column). On a PC a screen may use two
   columns inside .tk-column--wide. Breakpoints are fixed values, because media
   queries cannot read tokens: 700px and 1100px. */
.tk-column { width: 100%; max-width: var(--tk-column); margin-inline: auto; }
.tk-column--wide { max-width: var(--tk-column-wide); }
@media (min-width: 700px) {
  .tk-nav--rail { grid-template-columns: 1fr; grid-auto-rows: 76px; align-content: start; width: var(--tk-rail-w); padding: 8px 0 var(--tk-safe-bottom); border-top: 0; border-right: var(--tk-border) solid var(--tk-line); overflow-y: auto; }
  /* Touch still comes first on a tablet: the compact controls grow to the full 44px target. */
  .tk-btn--sm, .tk-chip, .tk-seg > button { min-height: var(--tk-touch); }
  .tk-nav--rail .tk-nav__item { min-height: 0; }
  .tk-nav--rail .tk-nav__item[aria-current="page"]::before { top: 18px; bottom: 18px; left: -2px; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .tk-scrim { align-items: center; padding: var(--tk-space-6) max(var(--tk-space-6), var(--tk-safe-right)) var(--tk-space-6) max(var(--tk-space-6), var(--tk-safe-left)); }
  .tk-sheet { max-height: 86vh; border-bottom: var(--tk-border) solid var(--tk-line); border-radius: var(--tk-radius-lg); padding-bottom: 16px; }
  .tk-toast { bottom: 32px; }
}

/* ---------- Held sideways: the side safe areas and the compact app bar (v0.5) ----------
   Every screen rotates (the phone's own rotation lock still decides). Held sideways, an iPhone's
   notch or Dynamic Island and its rounded corners sit at the left and right, inside
   --tk-safe-left / --tk-safe-right (0 in portrait and in the Android app, which keeps the page
   clear of the cutout itself).
   - The screen pads its sides by them once (.tk-screen above; #app > .screen in the app), so all
     of its content is clear. Nothing inside pads for them again. Sheets, toasts and the add button
     sit on the viewport, so they add the insets themselves (above).
   - The edge-to-edge chrome that sits straight in the screen paints its colour out into those two
     strips with box shadows, so the backgrounds still reach the screen edges. Paint only: nothing
     moves, and with no inset every shadow sits behind its own bar and nothing changes.
     The app bar and the hero take two shadows a side: the surface, shrunk by half the touchline
     so it stops above it and never spills past the bar, over the touchline colour, which then
     shows along the bottom, so the touchline runs to the edges too. */
@media (orientation: landscape) {
  .tk-appbar, .tk-hero {
    box-shadow:
      calc(-1 * var(--tk-safe-left) - var(--tk-touchline-width) / 2) calc(var(--tk-touchline-width) / -2) 0 calc(var(--tk-touchline-width) / -2) var(--tk-surface),
      calc(-1 * var(--tk-safe-left)) 0 0 var(--tk-touchline),
      calc(var(--tk-safe-right) + var(--tk-touchline-width) / 2) calc(var(--tk-touchline-width) / -2) 0 calc(var(--tk-touchline-width) / -2) var(--tk-surface),
      var(--tk-safe-right) 0 0 var(--tk-touchline);
  }
  .tk-nav { box-shadow: calc(-1 * var(--tk-safe-left)) 0 0 var(--tk-nav), var(--tk-safe-right) 0 0 var(--tk-nav); }
}
@media (orientation: landscape) and (min-width: 700px) {
  .tk-nav--rail { box-shadow: calc(-1 * var(--tk-safe-left)) 0 0 var(--tk-nav); }   /* the rail is on the left edge only */
}
/* A short landscape screen (a phone held sideways, 500px tall or less): the app bar goes to one line,
   --tk-appbar-h-compact tall (tokens.css swaps --tk-appbar-h, so its height and whatever sits below
   it follow), and the pitch gets the room. The title stays at the left; the eyebrow and sub-line
   follow it on the same line in their own small type and give way (then an ellipsis) before the
   title does. The buttons keep their 44px targets. */
@media (orientation: landscape) and (max-height: 500px) {
  .tk-appbar__text { flex-direction: row; align-items: baseline; gap: var(--tk-space-3); }
  .tk-appbar__title { order: -1; flex: 0 1 auto; min-width: 0; }
  .tk-appbar__eyebrow, .tk-appbar__sub { flex: 0 1000 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* iOS standalone: black-translucent status bar text is always white, so paint the notch area.
   Zero height on devices without a safe area. */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--tk-safe-top); background: var(--tk-statusbar); z-index: 1000; pointer-events: none; }
