/* Plate, 1RM and warm-up calculators, chip widgets and store badges. Shared by index.html and the
   tool pages; colour tokens come from each page. */
:root { --plate-25: #E5484D; --plate-20: #3E7BFA; --plate-15: #F5C542; --plate-10: #3FB950; --plate-5: #F4F5F2; --plate-2-5: #E5484D; --plate-1-25: #A3A6AD; }

/* ---------- Chips (native radios) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chips legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1.5px solid var(--line); font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip:has(input:checked) { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.chip:has(input:focus-visible) { outline: 3px solid var(--lime); outline-offset: 3px; }
@media (hover: hover) { .chip:not(:has(input:checked)):hover { border-color: var(--text); } }

/* ---------- Calculator card ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(24px, 3vw, 48px); display: grid; gap: 24px; align-content: start; }
.card h3 { font-size: clamp(28px, 3vw, 38px); }
.card > p { color: var(--muted); }
.card-link { color: var(--lime); font-weight: 600; text-underline-offset: 3px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: start; }
.input-field { display: grid; gap: 6px; }
.input-field label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.input-wrap { display: flex; align-items: center; min-height: 56px; border-radius: 14px; background: var(--surface-2); border: 2px solid transparent; padding: 0 16px; transition: border-color var(--dur-fast) var(--ease-out); }
.input-wrap:focus-within { border-color: var(--lime); }
.input-wrap input { flex: 1 1 0; min-width: 0; width: 100%; border: 0; background: none; font-size: 22px; font-weight: 700; outline: none; }
.input-wrap span { color: var(--muted); font-weight: 600; }
.input-field[data-invalid] .input-wrap { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 14px; font-weight: 500; }
.field-error:empty { display: none; }

/* ---------- Plate calculator ---------- */
.bar-viz { display: flex; align-items: center; min-height: 150px; padding: 16px; border-radius: 18px; background: var(--bg); overflow-x: auto; }
.bar-viz .shaft { flex: none; width: 56px; height: 16px; background: linear-gradient(#8a8d94, #5b5e64); border-radius: 3px 0 0 3px; }
.bar-viz .collar { flex: none; width: 14px; height: 40px; background: #6f7278; border-radius: 3px; }
.bar-viz .plates { display: flex; align-items: center; gap: 3px; margin-left: 3px; }
.plate { flex: none; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); animation: plateIn 240ms var(--ease-out) both; }
.bar-viz .sleeve { flex: 1 0 40px; max-width: 120px; height: 22px; background: linear-gradient(#b4b7bd, #7c7f85); border-radius: 0 4px 4px 0; }
@keyframes plateIn { from { opacity: 0; transform: translateX(-12px); } }
.plate-result { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; }
.plate-note { color: var(--muted); font-size: 15px; min-height: 24px; }
.plate-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.plate-legend li { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.plate-legend i { width: 12px; height: 12px; border-radius: 3px; }

/* ---------- 1RM ---------- */
.orm-result { display: grid; gap: 4px; padding: 24px; border-radius: 18px; background: var(--bg); }
.orm-result .k { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.orm-result .v { font-weight: 700; font-size: clamp(48px, 7vw, 72px); line-height: 1; color: var(--lime); white-space: nowrap; }
.orm-result .v small { font-size: .4em; color: var(--muted); margin-left: 6px; }
.orm-all { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0; list-style: none; }
.orm-all li { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.orm-all li span { display: block; font-size: 13px; color: var(--muted); }
.orm-all li b { display: block; font-size: 18px; white-space: nowrap; }
.pct-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.pct-table th, .pct-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pct-table th { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pct-table td { color: var(--muted); }
.pct-table td:nth-child(2) { color: var(--text); font-weight: 700; }

/* ---------- Store badges: official Apple and Google artwork, unmodified. Google's PNG carries
   its own clear space; the negative block margin lines its badge up with Apple's. ---------- */
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.store-badge { display: inline-flex; border-radius: 10px; }
.store-badge img { display: block; width: auto; height: 56px; }
.store-badge img.play { height: 84px; margin: -14px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- RPE and DOTS ---------- */
.input-wrap select { flex: 1 1 0; min-width: 0; width: 100%; border: 0; background: none; color: inherit; font: inherit; font-size: 18px; font-weight: 700; outline: none; min-height: 52px; cursor: pointer; }
.input-wrap select option { background: var(--surface-2); color: var(--text); }
.table-scroll { overflow-x: auto; }
.table-scroll .pct-table th, .table-scroll .pct-table td { padding: 8px; text-align: center; }
