/* Tape Measure */
#pic{touch-action:none}
#pic text{font-family:Lexend,Arial,sans-serif;font-weight:700}
#pic .thing *,#pic .tm-inst *{vector-effect:non-scaling-stroke}
#pic .thing text{font-weight:600}
#pic .shadow{fill:var(--ink);opacity:.1;stroke:none}
#pic .tm-strip{fill:#ffe98f;stroke:var(--ink);stroke-width:1.5}
#pic .tm-hook,#pic .tm-case{cursor:grab;outline:none}
#pic .tm-hook.grab,#pic .tm-case.grab{cursor:grabbing}
#pic .tm-hook:focus-visible .tm-hit,#pic .tm-case:focus-visible .tm-hit{stroke:var(--blue);stroke-width:3;stroke-dasharray:6 4}
#pic .tm-cones,#pic .tm-rings,#pic .tm-ext{pointer-events:none}
#pic .tm-prompt{font-weight:600;paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round}

/* the thing picker: the kit has no select, so it has the look of a kit button */
.tm-select{font:700 1em/1 var(--font-head);color:var(--ink);min-height:max(2.5em,42px);max-width:11em;padding:0 2.1em 0 .8em;border:2px solid var(--ink);border-radius:.6em;cursor:pointer;
  -webkit-appearance:none;appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23141a22' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .75em center/.8em auto}
.tm-select:hover{background-color:var(--grid)}

/* side panel */
#side{width:17em;gap:.6em}
.tm-task{margin:0;font-weight:700;font-size:1.05em;line-height:1.25}
.tm-card{display:flex;flex-direction:column;gap:.4em;padding:.5em .6em;border:2px solid var(--ink);border-radius:.8em;background:#fff}
.tm-h{margin:0;font-weight:700;font-size:.85em;color:var(--soft)}
.tm-est{display:flex;flex-wrap:wrap;align-items:center;gap:.35em .5em}
.tm-pair{display:inline-flex;align-items:center;gap:.3em;white-space:nowrap}
.tm-est .stepper button{width:max(1.9em,40px)}
.tm-est .stepper input{width:2.2ch}
.tm-unit{font-weight:700}
.tm-note{margin:0;font-size:.82em;font-weight:600;color:var(--soft);line-height:1.3}
.tm-note:empty{display:none}
#side>.toggle{align-self:flex-start}
.tm-ans{display:flex;flex-direction:column;justify-content:center;gap:.1em;min-height:3.2em;padding:.5em .7em;border:2px solid var(--ink);border-radius:.8em;background:var(--gold-tint);font-variant-numeric:tabular-nums}
.tm-ans.off{background:#fff;border-style:dashed;border-color:var(--line)}
.tm-ans:not(.off)~.tm-help{display:none}
.tm-ans p{margin:0}
.tm-ans .tm-big{font-size:2.05em;font-weight:700;line-height:1.05}
.tm-ans .tm-form{font-size:1.3em;font-weight:700;line-height:1.2}
.tm-ans .tm-diff{margin-top:.35em;font-size:.85em;font-weight:600;line-height:1.3}
.tm-hidden{color:var(--soft);font-weight:600;text-align:center}
.tm-help{margin:0;padding-left:1.25em;font-size:.85em;font-weight:600;line-height:1.35;color:var(--soft)}
.tm-help li{margin-bottom:.15em}

/* narrow tool (tablet, phone): the panel goes under the picture, in two columns, with a fixed height */
@container (max-width:860px){
  .tool-body{flex-direction:column}
  #side{width:auto;height:11.6em;flex:none;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto 1fr;align-content:start;gap:.4em .7em;padding:.45em .7em;border-left:0;border-top:2px solid var(--ink)}
  .tm-task{grid-column:1/-1}
  .tm-card{grid-row:2/4}
  .tm-ans{display:block;min-height:0;padding:.35em .6em;line-height:1.15}
  .tm-ans .tm-big{font-size:1.7em}
  .tm-ans .tm-form{display:inline;font-size:1.1em;margin-right:.45em}
  .tm-ans .tm-diff{font-size:.8em}
  .tm-help{display:none}
}
/* phone: a compact bar; the estimate on one row, the answer beside its button */
@container (max-width:520px){
  #bar{gap:.4em .45em;padding:.45em .5em}
  #bar .ctl-label{display:none}
  #bar .btn{padding:0 .62em}
  .tm-select{max-width:8.6em;padding-right:1.9em}
  #side{height:12em;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto 1fr;gap:.3em .5em;padding:.35em .5em}
  .tm-task{font-size:.92em}
  /* the estimate on one row under a small label; its value in cm is not shown here (the difference is) */
  .tm-card{grid-row:auto;grid-column:1/-1;gap:.15em;padding:0;border-width:0}
  .tm-card .tm-h{font-size:.75em}
  .tm-est{flex-wrap:nowrap;gap:.4em}
  .tm-note{display:none}
  #side>.toggle{align-self:start}
  .tm-ans{padding:.3em .5em}
  .tm-ans .tm-big{font-size:1.4em}
  .tm-ans .tm-form{font-size:.95em}
  .tm-ans .tm-diff{font-size:.85em;line-height:1.2;margin-top:.15em}
  .tm-why{display:none}
}
