/* Warm-up sets calculator (T67 stream W). Loaded on /tools/warm-up-calculator
   and its print sheet only. Tokens only on screen, phone first; the sheet is
   ink on paper. Every class is prefixed wu- or sits under .wu. Motion is
   transform and opacity, with a still path. */

.wu { display: grid; gap: 28px; }
.wu [hidden], .wu-under [hidden], .wu-setup [hidden] { display: none !important; }

/* ---- the working set */
.wu-form { display: grid; gap: 18px; }
.wu-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.wu .stepper { max-width: 100%; }
.wu .pm-weight input { min-width: 44px; max-width: 46vw; }
.no-js .wu [data-wu-step] { display: none; }
.no-js .wu .pm-weight input { border-bottom-color: var(--steel-light); }
.wu:not(.has-roll) .pm-roll { display: none; }
.js .wu-go { display: none; }
.wu-go { justify-self: start; }
.wu-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--iron-raised); }
.wu-seg a { display: inline-grid; place-items: center; min-width: 64px; min-height: 44px; border-radius: var(--r-button); color: var(--chalk-dim); font: 700 18px/1 var(--f-display); letter-spacing: .5px; text-transform: uppercase; text-decoration: none; }
.wu-seg a[aria-current="true"] { background: var(--chalk); color: var(--on-chalk); }

/* ---- bar and plates */
.wu-setup-wrap { margin-top: 28px; }
.wu-setup { display: grid; gap: 24px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.wu-setup .wu-go { margin-top: 14px; }
@media (min-width: 900px) { .wu-setup { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: 64px; } }
.wu-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.wu-group > .overline, .wu-group legend { padding: 0; margin-bottom: 12px; }
.wu-group .hint { margin-top: 12px; max-width: 34em; }

/* the plates you own, hung on a peg: pale when you have them, an outline when you do not */
.wu-rack { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 3px; }
.wu-plate { position: relative; display: inline-grid; place-items: center; width: clamp(44px, 12vw, 48px); height: 76px; }
.wu-plate::before { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 6px; margin-top: -3px; background: var(--steel); }
.wu-plate:first-child::before { left: 50%; }
.wu-plate input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.wu-plate-face { position: relative; display: grid; place-items: center; width: 100%; height: var(--h, 44px); border-radius: 8px; border: 2px dashed var(--steel-light); background: var(--iron-floor); color: var(--chalk-dim); font: 700 17px/1 var(--f-display); transition: transform 160ms cubic-bezier(.2, .8, .2, 1); }
.wu-plate input:checked + .wu-plate-face { border: 0; background: var(--chalk); color: var(--on-chalk); box-shadow: inset 0 1.5px 0 var(--plate-hl); }
.wu-plate input:focus-visible + .wu-plate-face { outline: 2px solid var(--chalk); outline-offset: 3px; }
@media (hover: hover) { .wu-plate:hover .wu-plate-face { transform: translateY(-3px); } }

/* ---- the answer, as a sentence */
.wu-result { display: grid; gap: 10px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.wu-say { max-width: 30em; font: 700 clamp(24px, 4.4vw, 40px)/1.12 var(--f-display); letter-spacing: .3px; }

/* ---- the ramp: one bar, one plate per set, the working set last
   --u is the drawing scale: 1 px on a phone, up to 2.4 px on a wide screen */
.wu-bleed { padding-inline: var(--gutter); }
/* a plate sliding on from the far end never widens the page */
.tool[data-tool="warm-up-calculator"] { overflow-x: clip; }
.wu-ramp {
  --u: clamp(1px, calc(1px + (100vw - 360px) / 700), 2.4px);
  --top: calc(104 * var(--u)); --pw: calc(26 * var(--u)); --head: calc(16 * var(--u) + 14px);
  position: relative; margin-top: 18px; padding-top: var(--head);
}
.wu-ramp::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--head) + var(--top) / 2 - 4 * var(--u)); height: calc(8 * var(--u)); border-radius: calc(4 * var(--u)); background: var(--steel); }
.wu-sleeve { position: absolute; top: calc(var(--head) + var(--top) / 2 - 11 * var(--u)); width: calc(10 * var(--u)); height: calc(22 * var(--u)); border-radius: 3px; background: var(--steel-light); }
.wu-sleeve:first-child { left: 0; }
.wu-sleeve + .wu-sleeve { right: 0; }
.wu-cols { position: relative; display: flex; justify-content: center; padding-inline: calc(14 * var(--u)); }
.wu-col { position: relative; flex: 1 1 0; min-width: 0; max-width: calc(120 * var(--u)); display: grid; justify-items: center; align-content: start; gap: 3px; padding-bottom: 16px; border-radius: var(--r-button); color: var(--chalk-dim); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.wu-col:focus-visible { outline: 2px solid var(--chalk); outline-offset: 2px; }
.wu-col-plate { position: relative; display: grid; place-items: center; width: 100%; height: var(--top); }
.wu-col-plate i { display: block; width: var(--pw); height: calc(var(--h) * var(--top)); border-radius: calc(6 * var(--u)); background: var(--chalk); box-shadow: inset 0 1.5px 0 var(--plate-hl), 1px 3px 3px var(--chalk-shade); transition: transform 160ms cubic-bezier(.2, .8, .2, 1), background-color 360ms ease, box-shadow 360ms ease; }
.wu-col-w { position: absolute; left: 50%; bottom: calc(50% + var(--h) * var(--top) / 2 + 6px); transform: translateX(-50%); font: 700 clamp(15px, calc(15 * var(--u)), 30px)/1 var(--f-display); letter-spacing: .2px; color: var(--chalk); white-space: nowrap; }
.wu-col-w small { margin-left: .14em; font-size: .6em; font-weight: 600; color: var(--chalk-dim); }
/* the empty bar is a collar, not a plate */
.wu-col.is-bare .wu-col-plate i { height: calc(18 * var(--u)); border-radius: calc(5 * var(--u)); background: var(--collar); box-shadow: none; }
.wu-col.is-bare .wu-col-w { bottom: calc(50% + 9 * var(--u) + 6px); }
.wu-col-r { font: 700 clamp(15px, calc(13 * var(--u)), 24px)/1.1 var(--f-display); letter-spacing: .3px; }
.wu-col-p { font: 600 clamp(11px, calc(10.5 * var(--u)), 15px)/1.2 var(--f-body); letter-spacing: .3px; }
.wu-col[aria-current="true"] .wu-col-r, .wu-col[aria-current="true"] .wu-col-p { color: var(--chalk); }
.wu-col::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 24px; height: 3px; margin-left: -12px; border-radius: 2px; background: var(--chalk); opacity: 0; transform: scaleX(.3); transition: opacity 160ms ease, transform 200ms cubic-bezier(.2, .8, .2, 1); }
.wu-col[aria-current="true"]::after { opacity: 1; transform: none; }
/* the working set is the one part that may glow */
.wu-work.is-live .wu-col-plate i { background: var(--ember); box-shadow: inset 0 1.5px 0 var(--plate-hl), 1px 3px 3px var(--ember-shade), 0 0 calc(12 * var(--u)) var(--ember-glow); }
.wu-work.is-live.is-bare .wu-col-plate i { box-shadow: 0 0 calc(12 * var(--u)) var(--ember-glow); }
.wu-work.is-live .wu-col-r { color: var(--ember-text); }
@media (hover: hover) { .wu-col:hover .wu-col-plate i { transform: translateY(-4px); } }
/* arrival: the plates slide on from the far end, one by one */
@keyframes wu-rack { 0% { opacity: 0; transform: translateX(calc(48 * var(--u))); } 60% { opacity: 1; transform: translateX(calc(-3 * var(--u))); } 100% { opacity: 1; transform: none; } }
@keyframes wu-rise { from { opacity: 0; transform: translateX(-50%) translateY(6px); } to { opacity: 1; transform: translateX(-50%); } }
.wu-ramp.is-racking .wu-col-plate i { animation: wu-rack 460ms cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(40ms + var(--i) * 60ms); }
.wu-ramp.is-racking .wu-col-w { animation: wu-rise 300ms ease-out both; animation-delay: calc(260ms + var(--i) * 60ms); }

/* ---- the picked set and its bar */
.wu-detail { display: grid; gap: 18px; margin-top: 8px; }
.wu-hint { text-align: center; }
.wu-pick { display: grid; gap: 10px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.wu-out { margin: 0; font: 700 clamp(64px, 15vw, 120px)/1 var(--f-display); letter-spacing: -.5px; }
.wu-note { max-width: 40em; min-height: 1.5em; font-size: 16px; line-height: 1.5; color: var(--chalk-dim); }
.wu-stage { margin-top: 18px; }
.wu-stage .wu-load:not(.ember-able) .pm-label:not(.is-out) { fill: var(--on-chalk); }
.no-js .wu-stage { height: auto; }
.no-js .wu-stage > svg { display: block; height: auto; }
.wu-under { display: grid; gap: 18px; margin-top: 18px; }
.wu-nav, .wu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.wu-nav .btn { text-decoration: none; }
.wu-nav .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.wu-actions { gap: 12px 24px; }

/* ---- every set, as a table */
.wu-more { margin-top: clamp(44px, 7vw, 72px); }
.wu-sec { min-width: 0; max-width: 820px; }
.wu-tbl { width: 100%; margin-top: 18px; border-collapse: collapse; }
.wu-tbl thead th { padding: 0 12px 8px 0; border-bottom: 1px solid var(--steel-light); text-align: left; vertical-align: bottom; font: 600 12px/1.3 var(--f-body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--chalk-dim); }
.wu-tbl tbody th, .wu-tbl td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: middle; }
.wu-tbl tbody th { width: 3.2em; font: 700 22px/1 var(--f-display); color: var(--chalk-dim); }
.wu-tbl td { font-size: 15px; }
.wu-load { white-space: nowrap; }
.wu-load b { font: 700 26px/1 var(--f-display); }
.wu-load span { font-size: 13px; color: var(--chalk-dim); }
.wu-reps { font: 700 22px/1 var(--f-display); }
.wu-tbl td.wu-reps { font-size: 22px; }
.wu-side { width: 46%; }
.wu-b { display: block; }
.wu-mini { display: block; width: 100%; max-width: 150px; height: auto; }
.wu-ps { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.3; color: var(--chalk-dim); }
.wu-x { display: none; color: var(--chalk-dim); }
@media (min-width: 480px) { .wu-tbl .wu-x { display: table-cell; } }
.wu-tbl tr.is-set th { color: var(--chalk); }
.wu-tbl tr.is-set td, .wu-tbl tr.is-set th { border-bottom-color: var(--steel-light); }

.wu-common td:first-child { white-space: nowrap; }
.wu-common td:first-child a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.wu-sources { padding-left: 1.6em; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.wu-sources li { padding-left: 4px; }

@media (prefers-reduced-motion: reduce) {
  .wu-col-plate i, .wu-col::after, .wu-plate-face { transition: none; }
  .wu-ramp.is-racking .wu-col-plate i, .wu-ramp.is-racking .wu-col-w { animation: none; }
  .wu-col:hover .wu-col-plate i, .wu-plate:hover .wu-plate-face { transform: none; }
}

/* ---- print sheet */
.wu-sheet-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.wu-sheet-form .field { margin: 0; }
.wu-sheet-form .input { min-height: 44px; }
.wu-sheet-plates { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; border: 0; }
.wu-sheet-plates legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.wu-sheet-plates label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; }
.wu-sheet-plates input { width: 20px; height: 20px; margin: 0; }
.wu-sheet-say { margin-top: 5mm; font: 700 15pt/1.2 var(--f-display); letter-spacing: .2px; }
.wu-sheet-tbl { margin-top: 5mm; }
.wu-sheet-tbl td, .wu-sheet-tbl th { height: 13mm; }
.wu-sheet-tbl .wu-sheet-n { font: 700 16pt/1 var(--f-display); white-space: nowrap; }
.wu-sheet-tbl .wu-sheet-side { white-space: nowrap; }
.wu-sheet-tbl .wu-mini { width: 40mm; height: auto; }
.wu-sheet-tbl .wu-mini .bb-bar { fill: #9a9a9a; }
.wu-sheet-tbl .wu-mini .bb-sleeve { fill: #6a6a6a; }
.wu-sheet-tbl .wu-mini .pl-body { fill: #111; }
.wu-sheet-done { width: 14%; }
.wu-sheet-notes { width: 24%; }
.wu-sheet-h2 { margin-top: 9mm; font-size: 15pt; }
.wu-sheet-next { margin-top: 3mm; table-layout: fixed; }
.wu-sheet-next th, .wu-sheet-next td { height: 8.4mm; padding: 1mm 2mm; }
.wu-sheet-next td { font: 700 12pt/1 var(--f-display); }
.wu-sheet-next td:first-child { font-size: 13pt; }
.wu-sheet-next .is-none { color: #777; font-weight: 400; }
.wu-sheet-note { margin-top: 4mm; font-size: 8.5pt; color: #333; }
