/* Unit toggle (see unit-toggle.mjs for the markup). THE ONE unit switch of the product (ft | m, lb | kg, ft | cm | m): small and quiet, 22px tall, 11px text, muted ink, a hairline
   border, and a soft tint on the active option only. No dark block, no bold, no uppercase. It sits inline, on the baseline of the row it belongs to.
   Site tokens only (the Equipment builder names its own, so each token has a fallback to the builder's).
   The VISUAL is small; the tap target is not: each option has an invisible 44 x 44px hit area centred on it (no layout change).
   Two markups, one look:
     .ut                 real radio inputs (works without JavaScript; a thumb slides behind the labels; --ut-i is set by :has() or by the script)
     .ut.ut-btn          buttons with role="radio" + aria-checked (the tools whose script already owns the state: .ut-b); the active one is filled in place
   Without JavaScript the radios still submit and :has() moves the thumb (up to four options). */
.ut { --ut-n: 2; --ut-i: 0; position: relative; display: inline-grid; grid-template-columns: repeat(var(--ut-n), minmax(34px, 1fr)); align-items: stretch; box-sizing: border-box; height: 22px; padding: 0; border: 1px solid var(--border, var(--line)); border-radius: 9999px; background: transparent; vertical-align: middle; isolation: isolate; font-size: 11px; line-height: 1.4; }
.ut-thumb { position: absolute; z-index: 0; top: 0; bottom: 0; left: 0; width: calc(100% / var(--ut-n)); border-radius: 9999px; background: color-mix(in srgb, var(--accent) 12%, transparent); transform: translateX(calc(var(--ut-i) * 100%)); transition: transform 150ms cubic-bezier(0.2, 0, 0, 1); will-change: transform; }
.ut:has(.ut-opt:nth-of-type(2) .ut-in:checked) { --ut-i: 1; }
.ut:has(.ut-opt:nth-of-type(3) .ut-in:checked) { --ut-i: 2; }
.ut:has(.ut-opt:nth-of-type(4) .ut-in:checked) { --ut-i: 3; }
.ut-opt { position: relative; z-index: 1; display: grid; place-items: center; min-width: 34px; padding: 0 8px; cursor: pointer; }
.ut .ut-in { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); opacity: 0; cursor: pointer; }
.ut-lab { font-size: 11px; font-weight: 500; line-height: 1.4; text-transform: none; letter-spacing: 0; color: var(--muted); transition: color 150ms ease; pointer-events: none; }
.ut-in:checked + .ut-lab { color: var(--ink); }
.ut:has(.ut-in:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the button markup */
.ut.ut-btn { display: inline-flex; }
.ut.ut-btn .ut-b { position: relative; box-sizing: border-box; min-width: 34px; height: 20px; min-height: 0; margin: 0; padding: 0 8px; font: inherit; font-size: 11px; font-weight: 500; line-height: 1.4; text-transform: none; letter-spacing: 0; color: var(--muted); background: transparent; border: 0; border-radius: 9999px; box-shadow: none; cursor: pointer; transition: color 150ms ease, background-color 150ms ease; }
.ut.ut-btn .ut-b[aria-checked="true"] { color: var(--ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ut.ut-btn .ut-b:hover { color: var(--ink); }
.ut.ut-btn .ut-b::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.ut.ut-btn .ut-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .ut-thumb, .ut-lab, .ut.ut-btn .ut-b { transition: none; } }
