/* 徒競走・リレーの組分けくん */
.tk-top .tk-title, .tk-top .tk-dist { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tk-top .tk-title { flex: 1 1 240px; }
.tk-top .tk-title .input { max-width: 320px; min-height: 36px; font-weight: 700; }
.tk-top .tk-dist .input { width: 84px; min-height: 36px; }
.tk-top span { white-space: nowrap; }
.tk-people { max-height: 440px; overflow: auto; }
.tk-people .input { min-height: 32px; padding: 3px 7px; font-size: 14px; }
.tk-people td { padding: 3px 5px; }

.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; margin-top: 12px; }
@media (max-width: 980px) { .tk-layout { grid-template-columns: 1fr; } }
.tk-side { display: grid; gap: 10px; min-width: 0; }
.tk-sec { border: 1px solid var(--line); border-radius: 14px; background: var(--card2); }
.tk-sec > summary { cursor: pointer; padding: 10px 14px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.tk-sec > summary::-webkit-details-marker { display: none; }
.tk-sec > summary::after { content: '▾'; color: var(--ink2); }
.tk-sec:not([open]) > summary::after { content: '▸'; }
.tk-sec > div { padding: 0 14px 14px; }
.tk-sec .seg button { padding: 5px 9px; font-size: 13px; }
.tk-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin-top: 10px; border: 1px solid color-mix(in srgb, var(--yellow) 60%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--yellow) 28%, var(--card)); position: sticky; top: calc(var(--header-h, 56px) + 6px); z-index: 5; box-shadow: var(--sh-sm); }

.tk-heats, .tk-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; min-width: 0; align-items: start; }
.tk-heat, .tk-team { border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--sh-sm); padding: 10px; min-width: 0; }
.tk-heat.sx-F { border-top: 3px solid color-mix(in srgb, var(--sho) 70%, var(--card)); }
.tk-heat.sx-M { border-top: 3px solid color-mix(in srgb, var(--chu) 70%, var(--card)); }
.tk-heat-h, .tk-team-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.tk-heat-h b, .tk-team-h b { font-size: 16px; }
.tk-when { font-size: 12.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.tk-stat { margin-left: auto; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; gap: 5px; }
.tk-stat small { font-weight: 700; font-size: 11px; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 16%, var(--card)); }
.tk-stat.wide small { background: color-mix(in srgb, var(--warn) 22%, var(--card)); }
.tk-lanes, .tk-order { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tk-lane { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 3px 8px 3px 4px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--card2); color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; touch-action: manipulation; min-width: 0; }
.tk-lane:hover { border-color: var(--line); }
.tk-lane.sel { outline: 3px solid var(--coral); outline-offset: 1px; }
.tk-lane.empty { background: transparent; border-style: dashed; }
.tk-lane .ln { flex-shrink: 0; width: 24px; height: 24px; border-radius: 99px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.tk-lane .nm { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.tk-lane .nm small { display: block; font-weight: 400; font-size: 10.5px; color: var(--ink2); }
.tk-lane .tm { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink2); flex-shrink: 0; }
.tk-lane.sx-M { background: color-mix(in srgb, var(--chu) 8%, var(--card)); }
.tk-lane.sx-F { background: color-mix(in srgb, var(--sho) 9%, var(--card)); }
.tk-mk { flex-shrink: 0; font-size: 10.5px; font-weight: 800; padding: 0 5px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); line-height: 1.5; white-space: nowrap; }
.tk-mk.on { background: var(--yellow); color: #1d2433; border-color: transparent; }
.tk-mk.nt { background: color-mix(in srgb, var(--blue) 18%, var(--card)); border-color: transparent; }
.tk-dot { width: 16px; height: 16px; border-radius: 99px; border: 1px solid var(--line); flex-shrink: 0; }
.tk-total { margin-left: auto; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.1; }
.tk-total small { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink2); }
.tk-short { margin: 0 0 8px; padding: 5px 8px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 12%, var(--card)); }
.tk-prog { padding: 14px; max-width: 520px; }
.tk-ptable td { padding: 5px 8px; }
.tk-care { margin: 16px 0 0; display: grid; gap: 4px; }
@media (max-width: 520px) { .tk-heats, .tk-teams { grid-template-columns: 1fr; } }
