/* measure.css
   On-screen measuring tool (measure-your-chip.html). Load after style.css.
   Own class names only (.msr), so nothing here changes another page. */

.msr{max-width:46rem}
.msr__step + .msr__step{margin-top:clamp(2rem,5vw,3rem)}
.msr__step > * + *{margin-top:1.125rem}
.msr__step > .title:focus{outline:none}
.msr__lead{color:var(--ink-2);max-width:36em}
.msr__lead strong{color:var(--ink);font-weight:600}

/* Round-ended choice buttons, the same shape as the site's other toggles. */
.msr__kinds{display:flex;flex-wrap:wrap;gap:.5rem}
.msr__kind{appearance:none;min-height:3rem;padding:.5rem 1.25rem;border:1.5px solid var(--line);border-radius:999px;background:#fff;color:var(--ink);font:600 1rem/1.2 var(--text);cursor:pointer;-webkit-tap-highlight-color:transparent}
.msr__kind:hover{border-color:var(--ink)}
.msr__kind[aria-pressed="true"]{border-color:var(--ink);background:var(--ink);color:#fff}

/* Slider row: smaller button, slider, larger button. */
.msr__ctl{display:grid;gap:.375rem}
.msr__sliderrow{display:flex;align-items:center;gap:.625rem}
.msr__nudge{flex:none;display:grid;place-items:center;width:3rem;height:3rem;padding:0;border:1.5px solid var(--ink-3);border-radius:50%;background:#fff;color:var(--ink);cursor:pointer;-webkit-tap-highlight-color:transparent}
.msr__nudge:hover{border-color:var(--ink);background:var(--glass-wash)}
.msr__nudge:disabled{border-color:var(--line);color:#9aa6b4;background:#f3f5f8;cursor:default}
.msr__nudge svg{width:1.125rem;height:1.125rem;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
.msr__range{flex:1 1 auto;min-width:0;width:100%;height:3rem;margin:0;padding:0;background:transparent;accent-color:var(--ink);cursor:pointer;-webkit-appearance:none;appearance:none}
.msr__range::-webkit-slider-runnable-track{height:.5rem;border-radius:99px;background:var(--glass-deep)}
.msr__range::-moz-range-track{height:.5rem;border-radius:99px;background:var(--glass-deep)}
.msr__range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:2rem;height:2rem;margin-top:-.75rem;border:3px solid #fff;border-radius:50%;background:var(--ink);box-shadow:0 0 0 1.5px var(--ink),0 2px 6px rgba(7,11,20,.3)}
.msr__range::-moz-range-thumb{width:1.625rem;height:1.625rem;border:3px solid #fff;border-radius:50%;background:var(--ink);box-shadow:0 0 0 1.5px var(--ink),0 2px 6px rgba(7,11,20,.3)}
.msr__range:focus-visible{outline:3px solid var(--focus);outline-offset:2px;border-radius:99px}
.msr__kind:focus-visible,.msr__nudge:focus-visible{outline:3px solid var(--focus);outline-offset:3px}

/* The drawing area. On a phone it runs almost edge to edge so a card fits. */
.msr__stage{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:.75rem;background:#f7f9fc}
@media (max-width:40rem){
  .msr__stage{margin-inline:calc(.25rem - var(--gutter));border-radius:.5rem}
}
.msr__stage--ref{padding:0;min-height:6rem}
.msr__ref{position:relative;box-sizing:border-box;border:2px solid var(--red);background:rgba(255,255,255,.78);box-shadow:0 0 0 1px rgba(255,255,255,.9)}
.msr__ref::before,.msr__ref::after{content:"";position:absolute;left:0;top:0;background:var(--ink)}
.msr__ref::before{width:1.5rem;height:3px}
.msr__ref::after{width:3px;height:1.5rem}
.msr__ref--quarter{border-radius:50%}
.msr__ref--quarter::before,.msr__ref--quarter::after{display:none}
.msr__reflabel{position:absolute;inset:0;display:grid;place-items:center;padding:.5rem;font:500 .875rem/1.3 var(--text);color:var(--ink-2);text-align:center;pointer-events:none}
.msr__ref--quarter .msr__reflabel{font-size:.75rem;padding:.25rem}
.msr__facts{max-width:36em}

.msr__draw{display:block;max-width:none;margin-inline:auto;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.msr__draw--ruler{margin-inline:0;cursor:ew-resize}
.msr__draw text{font-family:var(--text);fill:var(--ink-2)}
.msr__ring{fill:none;stroke:#aebcd0;stroke-width:1}
.msr__ring--ten{stroke:#7f93b0}
.msr__dot{fill:none;stroke:var(--red);stroke-width:2.5}
.msr__dotfill{fill:rgba(223,34,41,.1)}
.msr__cross{stroke:var(--ink);stroke-width:1}
.msr__tick{stroke:var(--ink);stroke-width:1}
.msr__edge{stroke:var(--ink);stroke-width:2}
.msr__mark{stroke:var(--red);stroke-width:2.5}
.msr__markhead{fill:var(--red)}
.msr__span{fill:rgba(223,34,41,.12)}

.msr__read{font:600 1.375rem/1.25 var(--text);color:var(--ink)}
.msr__read small{display:block;margin-top:.125rem;font:400 1rem/1.4 var(--text);color:var(--ink-2)}
.msr__result{padding:1.125rem 1.25rem;border:1px solid var(--line);border-radius:1.25rem;background:var(--glass-wash)}
.msr__result > * + *{margin-top:.75rem}
.msr__status{min-height:1.5em;font-weight:500;color:var(--ink)}
.msr__warn{border-left-color:var(--red);background:var(--red-wash)}
.msr__done{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem 1rem;padding:.75rem 1.125rem;border:1px solid var(--line);border-radius:1.25rem;background:var(--glass-wash)}
.msr__done p{margin:0;font-weight:500}
.msr__panel > * + *{margin-top:1.125rem}

@media (prefers-reduced-motion:no-preference){
  .msr__kind,.msr__nudge{transition:background-color .15s ease,border-color .15s ease,color .15s ease}
}
