/* =====================================================================
   Tournaments, made simple (Admin lane). Plan: docs/tournaments-made-simple-plan.md; drawings: Figma file
   "Ubipass app", page "Tournaments, made simple". Loaded by admin.html only, after admin-ubipass.css.
   Every rule is scoped to the tournament area (#tourneyBox) or to a tournament pop-up (.tm-sheet), so the other admin
   pages, the staff pages and the member app are untouched. Colours are the admin tokens (--a-*): light and dark follow
   the computer, as on the rest of the admin page.
   Build 1 of 8 (2026-11-28): the parts, and the tournament list with "Check and approve".
   The 7-year-old rules: one main button per screen, pictures first, plain words, tapping not typing, big jobs as
   steps, advanced things under "More options", see it before and Undo after, always one next step, targets 48 px or
   more, text 16 px for sentences (14 px only for short labels), never colour alone.
   ===================================================================== */

/* Fixed ink for words on the accent fills (orange, lime, coral, mauve), in light and dark mode alike. */
html body.kp-admin :is(#tourneyBox, .tm-sheet) { --tm-ink: #1A0E08; --tm-gap: 16px; }

/* ---------- Words ---------- */
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-lede { margin: 0; font-size: 16px; line-height: 1.5; color: var(--a-muted); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-title { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; color: var(--a-text); overflow-wrap: anywhere; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-meta { margin: 0; font-size: 14px; line-height: 1.45; font-weight: 600; color: var(--a-muted); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-say { margin: 0; font-size: 16px; line-height: 1.5; color: var(--a-text); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-label { margin: 0; font-size: 14px; font-weight: 800; color: var(--a-muted); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) svg.tm-i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) svg.tm-i.s16 { width: 16px; height: 16px; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) svg.tm-i.s20 { width: 20px; height: 20px; }

/* ---------- Buttons: main (one per screen), second, text, round ---------- */
html body.kp-admin :is(#tourneyBox, .tm-sheet) :is(button.tm-main, button.tm-second, button.tm-textbtn) {
  min-height: 52px; padding: 0 20px !important; border-radius: 14px !important; font: inherit; font-size: 16px !important; font-weight: 800 !important;
  line-height: 1.25; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; cursor: pointer; box-shadow: none !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-main { background: var(--a-blue) !important; color: var(--a-cream) !important; border: 1.5px solid var(--a-blue) !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-main:hover:not(:disabled) { background: var(--a-blue-h) !important; border-color: var(--a-blue-h) !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-second { background: var(--a-card) !important; color: var(--a-link) !important; border: 1.5px solid var(--a-line) !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-second:hover:not(:disabled) { border-color: var(--a-link) !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-textbtn { background: transparent !important; color: var(--a-link) !important; border: 0 !important;
  text-decoration: underline; text-underline-offset: 3px; padding: 0 8px !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) :is(button.tm-main, button.tm-second):disabled { background: var(--a-soft) !important; color: var(--a-muted) !important;
  border-color: var(--a-soft) !important; cursor: not-allowed; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-round { width: 48px; height: 48px; min-height: 48px; padding: 0 !important; border-radius: 999px !important; flex: none;
  display: inline-flex; align-items: center; justify-content: center; background: var(--a-card) !important; color: var(--a-text) !important;
  border: 1.5px solid var(--a-line) !important; box-shadow: none !important; cursor: pointer; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-round:hover { border-color: var(--a-link) !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-wide { width: 100%; }

/* ---------- "How does this work?": a small link, never in the way ---------- */
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-help { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px !important;
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--a-link) !important; font-size: 16px !important; font-weight: 800 !important;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; align-self: flex-start; }

/* ---------- Labels with an icon, a word and a colour (never colour alone) ---------- */
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px 4px 10px;
  border-radius: 999px; font-size: 14px; font-weight: 800; line-height: 1.2; align-self: flex-start; background: var(--a-soft); color: var(--a-text); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-pill.is-wait { background: var(--a-orange); color: var(--tm-ink); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-pill.is-off { background: var(--a-err-soft); color: var(--a-text); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-pill.is-off svg { color: var(--a-err); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-pill.is-live { background: var(--a-ok-soft); color: var(--a-text); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-pill.is-live svg { color: var(--a-ok); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; border-radius: 999px;
  background: var(--a-orange); color: var(--tm-ink); font-size: 14px; font-weight: 800; align-self: flex-start; }
/* The four states of a match: Waiting, Playing now, Done, Team didn't come */
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-state { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 10px 4px 8px; border-radius: 999px;
  font-size: 14px; font-weight: 800; line-height: 1.2; align-self: flex-start; background: var(--a-soft); color: var(--a-text); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-state.is-playing { background: var(--a-coral); color: var(--tm-ink); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-state.is-done { background: var(--a-lime); color: var(--tm-ink); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-state.is-noshow { background: var(--a-mauve); color: var(--tm-ink); }

/* ---------- Notes: look only, fix it, only you can see this, players can see this ---------- */
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-note { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 16px;
  font-size: 16px; line-height: 1.45; font-weight: 600; background: var(--a-soft); color: var(--a-text); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-note svg { margin-top: 1px; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-note.is-fix { background: var(--a-err-soft); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-note.is-fix svg { color: var(--a-err); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-note.is-only { background: var(--a-orange); color: var(--tm-ink); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-note.is-live { background: var(--a-ok-soft); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-note.is-live svg { color: var(--a-ok); }

/* ---------- Cards ---------- */
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-card { background: var(--a-card) !important; border: 1px solid var(--a-line) !important; border-radius: 22px !important;
  padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; overflow: hidden; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-card.has-photo { padding-top: 0; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-photo { display: block; width: calc(100% + 32px); max-width: none; margin: 0 -16px 6px; height: 150px; object-fit: cover; }
html body.kp-admin #tourneyBox .tm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: var(--tm-gap); align-items: start; }

/* ---------- A week: a big button with its date, what is happening, and how many teams ask to play ---------- */
html body.kp-admin #tourneyBox button.tm-week { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px !important;
  border-radius: 16px !important; background: var(--a-tint) !important; color: var(--a-text) !important; border: 1.5px solid transparent !important; text-align: left;
  font: inherit; font-weight: 600 !important; box-shadow: none !important; cursor: pointer; }
html body.kp-admin #tourneyBox button.tm-week:hover { border-color: var(--a-link) !important; }
html body.kp-admin #tourneyBox button.tm-week > svg:first-child { color: var(--a-link); }
html body.kp-admin #tourneyBox button.tm-week > svg:last-child { color: var(--a-muted); }
html body.kp-admin #tourneyBox .tm-week-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html body.kp-admin #tourneyBox .tm-week-text b { font-size: 16px; font-weight: 800; color: var(--a-text); }
html body.kp-admin #tourneyBox .tm-week-text small { font-size: 14px; font-weight: 600; color: var(--a-muted); line-height: 1.4; }
html body.kp-admin #tourneyBox .tm-weeks { display: flex; flex-direction: column; gap: 8px; }

/* ---------- More options (closed by default) ---------- */
html body.kp-admin :is(#tourneyBox, .tm-sheet) details.tm-more { border: 1px solid var(--a-line); border-radius: 18px; background: var(--a-card); overflow: hidden; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) details.tm-more > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 16px;
  font-size: 16px; font-weight: 800; color: var(--a-text); cursor: pointer; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) details.tm-more > summary::-webkit-details-marker { display: none; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) details.tm-more > summary::after { content: none !important; display: none !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) details.tm-more > summary > span { flex: 1 1 auto; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) details.tm-more > summary > svg { transition: transform 160ms ease; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) details.tm-more[open] > summary > svg { transform: rotate(180deg); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-more-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px !important;
  border: 0 !important; border-top: 1px solid var(--a-rule) !important; border-radius: 0 !important; background: transparent !important; color: var(--a-text) !important;
  text-align: left; font: inherit; box-shadow: none !important; cursor: pointer; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-more-item:hover { background: var(--a-hover) !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-more-item > svg:first-child { color: var(--a-link); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-more-item > svg:last-child { color: var(--a-muted); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-more-item span { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-more-item b { font-size: 16px; font-weight: 800; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-more-item small { font-size: 14px; font-weight: 600; color: var(--a-muted); }

/* A very narrow card (a phone with the text twice as big): the small pictures in the rows make room for the words. */
html body.kp-admin #tourneyBox .tm-card { container-type: inline-size; }
@container (max-width: 280px) {
  html body.kp-admin #tourneyBox :is(button.tm-week, button.tm-more-item, details.tm-more > summary) { padding: 10px 12px !important; }
  html body.kp-admin #tourneyBox :is(button.tm-week, button.tm-more-item, details.tm-more > summary) > svg { display: none; }
  html body.kp-admin #tourneyBox :is(.tm-week-text, .tm-more-item span, details.tm-more > summary > span) { min-width: 0; overflow-wrap: anywhere; }
}

/* ---------- The list's top: one sentence, "How does this work?", and the one main button ---------- */
html body.kp-admin #tourneyBox .tm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
html body.kp-admin #tourneyBox .tm-head-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html body.kp-admin #tourneyBox .tm-head button.tm-main { flex: 0 0 auto; min-width: 260px; }
html body.kp-admin #tourneyBox .tm-list { display: flex; flex-direction: column; gap: var(--tm-gap); }
/* An empty screen: a picture, one sentence, and the one next step */
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-next { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 24px; background: var(--a-tint); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-next-pic { width: 56px; height: 56px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--a-card); color: var(--a-link); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-next-pic svg { width: 28px; height: 28px; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-next h3 { margin: 0; font-size: 22px; font-weight: 800; }
html body.kp-admin #tourneyBox .tm-next button.tm-main { align-self: flex-start; width: auto; min-width: 280px; }

/* ---------- Pop-ups (sheets): a title with a round ×, and its facts ---------- */
html body.kp-admin .modal .card:has(> .tm-sheet) { max-width: 560px; }
html body.kp-admin .modal .card:has(> .tm-sheet.tm-own-buttons) > button[data-close]:last-child { display: none; }
html body.kp-admin .tm-sheet { display: flex; flex-direction: column; gap: 14px; }
html body.kp-admin .tm-sheet .tm-sheet-head { display: flex; align-items: center; gap: 12px; }
html body.kp-admin .tm-sheet .tm-sheet-head > div { flex: 1 1 auto; min-width: 0; }
html body.kp-admin .tm-sheet .tm-sheet-head h2 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 800; }
html body.kp-admin .tm-sheet dl.tm-facts { margin: 0; padding: 14px 16px; border: 1px solid var(--a-line); border-radius: 18px; background: var(--a-card);
  display: grid; grid-template-columns: minmax(84px, auto) 1fr; gap: 8px 14px; }
html body.kp-admin .tm-sheet dl.tm-facts dt { font-size: 14px; font-weight: 800; color: var(--a-muted); padding-top: 2px; }
html body.kp-admin .tm-sheet dl.tm-facts dd { margin: 0; font-size: 16px; font-weight: 600; color: var(--a-text); overflow-wrap: anywhere; white-space: pre-line; }
html body.kp-admin .tm-sheet .tm-steps-how { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: tmstep; }
html body.kp-admin .tm-sheet .tm-steps-how li { counter-increment: tmstep; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px;
  border: 1px solid var(--a-line); background: var(--a-card); }
html body.kp-admin .tm-sheet .tm-steps-how li::before { content: counter(tmstep); flex: none; width: 40px; height: 40px; border-radius: 999px; display: flex;
  align-items: center; justify-content: center; background: var(--a-blue); color: var(--a-cream); font-size: 18px; font-weight: 800; }
html body.kp-admin .tm-sheet .tm-steps-how b { display: block; font-size: 18px; font-weight: 800; }
html body.kp-admin .tm-sheet .tm-steps-how span { display: block; font-size: 16px; line-height: 1.45; }
html body.kp-admin .tm-sheet .tm-buttons { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Parts for the next builds (drawn; not used on a page yet) ---------- */
/* Match card */
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-match { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; min-width: 0;
  background: var(--a-card); border: 1px solid var(--a-line); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-match.is-playing { border: 2px solid var(--a-coral); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-match .tm-team { display: flex; align-items: baseline; gap: 6px; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-match .tm-team > span { flex: 1 1 auto; min-width: 0; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-match .tm-team.is-lost { font-weight: 600; color: var(--a-muted); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-match .tm-team b { font-size: 20px; }
/* Choice tile: a big picture choice instead of a drop-down list (a button with aria-pressed) */
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-tile { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 16px !important; min-height: 56px;
  border-radius: 18px !important; background: var(--a-card) !important; color: var(--a-text) !important; border: 1.5px solid var(--a-line) !important; text-align: left;
  font: inherit; box-shadow: none !important; cursor: pointer; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-tile[aria-pressed="true"] { background: var(--a-tint) !important; border: 3px solid var(--a-link) !important; padding: 14.5px !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-tile-pic { width: 48px; height: 48px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--a-tint); color: var(--a-link); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-tile[aria-pressed="true"] .tm-tile-pic { background: var(--a-blue); color: var(--a-cream); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-tile-tick { width: 28px; height: 28px; border-radius: 999px; border: 2px solid var(--a-line); display: flex;
  align-items: center; justify-content: center; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-tile[aria-pressed="true"] .tm-tile-tick { background: var(--a-blue); border-color: var(--a-blue); color: var(--a-cream); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-tile b { font-size: 18px; font-weight: 800; line-height: 1.3; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-tile small { font-size: 14px; font-weight: 600; color: var(--a-muted); line-height: 1.4; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 8px; }
/* − and + (56 for numbers, 72 on the scoreboard), and the number picker */
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-pm { width: 56px; height: 56px; min-height: 56px; padding: 0 !important; border-radius: 999px !important; flex: none;
  display: inline-flex; align-items: center; justify-content: center; background: var(--a-tint) !important; color: var(--a-link) !important; border: 0 !important;
  box-shadow: none !important; cursor: pointer; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-pm.is-big { width: 72px; height: 72px; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-pm svg { width: 28px; height: 28px; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-num { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; background: var(--a-card); border: 1px solid var(--a-line); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-num output { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; font-size: 34px; font-weight: 800; line-height: 1.15; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-num output small { font-size: 14px; font-weight: 600; color: var(--a-muted); }
/* Step header: "Step 1 of 3", a progress bar, the one question */
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-step-top { display: flex; align-items: center; gap: 12px; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-step-top .tm-label { flex: 1 1 auto; font-size: 16px; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-progress { display: flex; gap: 6px; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-progress i { flex: 1 1 0; height: 8px; border-radius: 4px; background: var(--a-line); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-progress i.on { background: var(--a-link); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-question { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
/* Group tab (and week tab): a big button that shows which one is open */
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-tab { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px;
  padding: 8px 18px !important; border-radius: 16px !important; background: var(--a-card) !important; color: var(--a-text) !important; border: 1.5px solid var(--a-line) !important;
  font: inherit; font-weight: 800 !important; box-shadow: none !important; cursor: pointer; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-tab small { font-size: 14px; font-weight: 600; color: var(--a-muted); }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-tab[aria-pressed="true"] { background: var(--a-blue) !important; border-color: var(--a-blue) !important; color: var(--a-cream) !important; }
html body.kp-admin :is(#tourneyBox, .tm-sheet) button.tm-tab[aria-pressed="true"] small { color: var(--a-cream); }
/* Undo bar: after a change, for 10 seconds */
html body.kp-admin .tm-undo { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 18px; background: var(--a-text); color: var(--a-page);
  font-size: 16px; font-weight: 600; max-width: min(560px, calc(100vw - 32px)); }
html body.kp-admin .tm-undo > span { flex: 1 1 auto; }
html body.kp-admin .tm-undo button { min-height: 48px; padding: 0 16px !important; border-radius: 14px !important; background: var(--a-page) !important; color: var(--a-text) !important;
  border: 0 !important; font-weight: 800 !important; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Build 2: the 4 steps of "New tournament" and "Change settings" (Figma P4–P7, P4b–P4e, P7b, P7c) ---------- */
html body.kp-admin #modalCard .tm-sheet.tm-wz { gap: 16px; }
html body.kp-admin #modalCard .tm-sheet .tm-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
html body.kp-admin #modalCard .tm-sheet .tm-input { width: 100%; box-sizing: border-box; min-height: 52px; padding: 12px 16px !important; border-radius: 14px !important;
  font: inherit; font-size: 16px !important; line-height: 1.4; }
html body.kp-admin #modalCard .tm-sheet textarea.tm-input { min-height: 104px; resize: vertical; }
html body.kp-admin #modalCard .tm-sheet .tm-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 6px 6px 16px; border: 1px solid var(--a-line);
  border-radius: 18px; background: var(--a-card); }
html body.kp-admin #modalCard .tm-sheet .tm-row > svg { color: var(--a-link); }
html body.kp-admin #modalCard .tm-sheet :is(.tm-row-text, .tm-grp-text) { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
html body.kp-admin #modalCard .tm-sheet :is(.tm-row-text, .tm-grp-text) b { font-size: 16px; font-weight: 800; color: var(--a-text); }
html body.kp-admin #modalCard .tm-sheet :is(.tm-row-text, .tm-grp-text) small { font-size: 14px; font-weight: 600; color: var(--a-muted); }
html body.kp-admin #modalCard .tm-sheet .tm-place { display: flex; flex-wrap: wrap; gap: 12px; }
html body.kp-admin #modalCard .tm-sheet .tm-place label { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 14px; font-weight: 800; color: var(--a-muted); }
html body.kp-admin #modalCard .tm-sheet .tm-place select { min-height: 52px; font-size: 16px; padding: 0 12px; }
/* "Run by" for an organization's admin: its own organization, nothing to choose */
html body.kp-admin #modalCard .tm-sheet div.tm-tile.is-fixed { display: flex; flex-direction: column; gap: 10px; padding: 14.5px; border-radius: 18px; background: var(--a-tint);
  border: 3px solid var(--a-link); color: var(--a-text); }
html body.kp-admin #modalCard .tm-sheet div.tm-tile.is-fixed .tm-tile-pic { background: var(--a-blue); color: var(--a-cream); }
html body.kp-admin #modalCard .tm-sheet div.tm-tile.is-fixed .tm-tile-tick { background: var(--a-blue); border-color: var(--a-blue); color: var(--a-cream); }
html body.kp-admin #modalCard .tm-sheet .tm-tiles.is-list { grid-template-columns: 1fr; }
html body.kp-admin #modalCard .tm-sheet .tm-more-in { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--a-line); }
html body.kp-admin #modalCard .tm-sheet .tm-more-in button.tm-textbtn { align-self: flex-start; }
html body.kp-admin #modalCard .tm-sheet .tm-pic { display: block; width: 100%; max-width: none; height: 150px; border-radius: 16px; object-fit: cover; }
html body.kp-admin #modalCard .tm-sheet .tm-pic.is-empty { display: flex; align-items: center; justify-content: center; background: var(--a-tint); color: var(--a-link); }
html body.kp-admin #modalCard .tm-sheet .tm-pic.is-empty svg { width: 32px; height: 32px; }
/* The day: 7 buttons, 4 to a row, as drawn */
html body.kp-admin #modalCard .tm-sheet .tm-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
html body.kp-admin #modalCard .tm-sheet .tm-days button.tm-tab { width: 100%; padding: 8px 4px !important; }
/* A group: open (its times and limit) or closed (one line and "Change") */
html body.kp-admin #modalCard .tm-sheet .tm-grp { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border: 1px solid var(--a-line); border-radius: 18px;
  background: var(--a-card); }
html body.kp-admin #modalCard .tm-sheet .tm-grp.is-open { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px; border-radius: 22px; }
html body.kp-admin #modalCard .tm-sheet .tm-grp-top { display: flex; align-items: center; gap: 12px; }
html body.kp-admin #modalCard .tm-sheet .tm-grp-top h3 { flex: 1 1 auto; margin: 0; font-size: 20px; font-weight: 800; color: var(--a-text); }
html body.kp-admin #modalCard .tm-sheet .tm-grp-letter { width: 40px; height: 40px; flex: none; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--a-blue); color: var(--a-cream); font-size: 18px; font-weight: 800; }
html body.kp-admin #modalCard .tm-sheet .tm-num button.tm-pm:disabled { opacity: 0.45; cursor: not-allowed; }
/* "Already picked for you" and "Two ways to play" */
html body.kp-admin #modalCard .tm-sheet .tm-picked { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 18px; background: var(--a-soft); }
/* "Running": a switch; the whole row can be tapped */
html body.kp-admin #modalCard .tm-sheet label.tm-switch { display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: 48px; margin: 0; cursor: pointer; }
html body.kp-admin #modalCard .tm-sheet label.tm-switch > span { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html body.kp-admin #modalCard .tm-sheet label.tm-switch b { font-size: 16px; font-weight: 800; color: var(--a-text); }
html body.kp-admin #modalCard .tm-sheet label.tm-switch small { font-size: 14px; font-weight: 600; color: var(--a-muted); }
html body.kp-admin #modalCard .tm-sheet label.tm-switch input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 52px; height: 32px; margin: 0;
  border-radius: 999px; background: var(--a-muted) !important; border: 0 !important; cursor: pointer; transition: background 160ms ease;
  min-height: 0 !important; height: 32px !important; padding: 0 !important; box-shadow: none !important; }
html body.kp-admin #modalCard .tm-sheet label.tm-switch input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 999px;
  background: #FFFFFF; transition: transform 160ms ease; }
html body.kp-admin #modalCard .tm-sheet label.tm-switch input:checked { background: var(--a-blue) !important; }
html body.kp-admin #modalCard .tm-sheet label.tm-switch input:checked::before { transform: translateX(20px); }
html body.kp-admin #modalCard .tm-sheet label.tm-switch input:focus-visible { outline: 3px solid var(--a-link) !important; outline-offset: 2px; }
html body.kp-admin #modalCard .tm-sheet .tm-question:focus { outline: none; }
/* Very narrow (a phone with the text twice as big): the header wraps, 2 days to a row, and each number sits above its − and + */
html body.kp-admin #modalCard .tm-sheet.tm-wz { container-type: inline-size; }
@container (max-width: 260px) {
  html body.kp-admin #modalCard .tm-sheet .tm-step-top { flex-wrap: wrap; }
  html body.kp-admin #modalCard .tm-sheet .tm-step-top .tm-label { min-width: 0; }
  html body.kp-admin #modalCard .tm-sheet .tm-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body.kp-admin #modalCard .tm-sheet .tm-grp-top { flex-wrap: wrap; }
  html body.kp-admin #modalCard .tm-sheet .tm-grp.is-open { padding: 12px; }
  html body.kp-admin #modalCard .tm-sheet .tm-num { flex-wrap: wrap; justify-content: space-between; }
  html body.kp-admin #modalCard .tm-sheet .tm-num output { order: -1; flex: 1 1 100%; }
  html body.kp-admin #modalCard .tm-sheet :is(.tm-row, .tm-grp, label.tm-switch) { flex-wrap: wrap; }
  html body.kp-admin #modalCard .tm-sheet label.tm-switch > span { flex-basis: 100%; }
  html body.kp-admin #modalCard .tm-sheet :is(.tm-row-text, .tm-grp-text, .tm-tile b, .tm-tile small, .tm-say, .tm-question) { overflow-wrap: anywhere; }
}

/* ---------- Phones: one column; the main button full width ---------- */
@media (max-width: 767px) {
  /* The 4 steps open as a full-screen sheet on a phone (plan, section 3) */
  html body.kp-admin .modal:has(.tm-wz) { padding: 0; }
  html body.kp-admin .modal .card:has(> .tm-wz) { max-width: none; width: 100%; height: 100%; max-height: none; border-radius: 0 !important; border: 0 !important; }
  html body.kp-admin #tourneyBox .tm-head { flex-direction: column; align-items: stretch; }
  html body.kp-admin #tourneyBox .tm-head-text { flex: 0 0 auto; }
  html body.kp-admin #tourneyBox :is(.tm-head, .tm-next) button.tm-main { width: 100%; min-width: 0; align-self: stretch; }
  html body.kp-admin :is(#tourneyBox, .tm-sheet) .tm-title { font-size: 20px; }
}
/* Less motion: the "More options" arrow doesn't turn */
@media (prefers-reduced-motion: reduce) {
  html body.kp-admin :is(#tourneyBox, .tm-sheet) details.tm-more > summary > svg { transition: none; }
  html body.kp-admin .tm-sheet label.tm-switch input, html body.kp-admin .tm-sheet label.tm-switch input::before { transition: none; }
}
