/* Rise and Run */
/* touch-action on an SVG <g> has no effect in Chrome, so a finger drag became a page pan; it must be on the <svg> */
#pic{touch-action:none}
#pic .pt{cursor:grab;outline:none}
#pic .pt.held{cursor:grabbing}
#pic .pt-shadow{fill:var(--ink);opacity:.16}
#pic .pt-ring{fill:none;stroke:var(--gold);stroke-width:4;opacity:0}
#pic .pt:focus-visible .pt-ring,#pic .pt.held .pt-ring{opacity:1}
#pic .nums text{paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}
#pic .axname{font-weight:700;fill:var(--ink)}
#pic .lbl{pointer-events:none}

#side{width:23em;gap:.45em}
#side::before,#side::after{content:"";margin:auto}
.sl-card{flex:none;display:flex;flex-direction:column;gap:.25em;padding:.4em .7em;border:2px solid var(--ink);border-radius:.8em;background:#fff}
.sl-card p{margin:0}
.sl-head{font:600 .82em var(--font-head);color:var(--soft)}
.ka{color:#178f45}
.kb{color:var(--purple)}
.sl-coords{font-weight:700;font-size:1.05em;font-variant-numeric:tabular-nums}
.sl-rr{display:flex;flex-wrap:wrap;gap:.35em}
.chip{display:inline-flex;align-items:center;gap:.3em;padding:.2em .5em;border:2px solid currentColor;border-radius:.5em;font-weight:700;font-size:1.1em;font-variant-numeric:tabular-nums;white-space:nowrap}
.chip.run{color:var(--blue);background:var(--blue-tint)}
.chip.rise{color:var(--red);background:var(--red-tint)}
.chip .arr{width:1em;height:1em;flex:none}
.sl-note{font:400 .82em/1.25 var(--font-body);color:#39424e}
.t-rise{color:var(--red)}
.t-run{color:var(--blue)}

.sl-big{display:flex;align-items:center;justify-content:center;gap:.25em;min-height:3.6em;font-variant-numeric:tabular-nums}
.fr{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;line-height:1.05}
.fr-n{padding:0 .12em .04em;border-bottom:.09em solid var(--ink)}
.fr-d{padding:.04em .12em 0}
.fr.big{font-size:2.6em;font-weight:700}
.fr.big .fr-n{color:var(--red);border-bottom-width:.07em}
.fr.big .fr-d{color:var(--blue)}
.caps{display:flex;flex-direction:column;justify-content:space-between;align-self:stretch;padding:.5em 0;text-align:right;font-size:.8em;font-weight:600}
.eqs{font-size:2em;font-weight:700;margin:0 .1em}
.signed,.whole{display:inline-flex;align-items:center;font-weight:700}
.big2{font-size:2em}
.big2 .fr-n{border-bottom-width:.07em}
.sl-q{font-size:3em;font-weight:700;color:var(--soft)}
.sl-msg{font:700 1em/1.3 var(--font-head);text-align:center;color:var(--ink)}
.sl-dec{font-weight:700;font-size:1.1em;text-align:center;font-variant-numeric:tabular-nums}
.sl-type{font:400 .9em/1.3 var(--font-body)}
.badge{display:inline-block;padding:.05em .45em;margin-right:.15em;border-radius:.4em;font:700 1.05em/1.3 var(--font-head);color:#fff;background:var(--ink)}
.badge.k-positive{background:var(--green)}
.badge.k-negative{background:var(--purple)}
.badge.k-zero{background:var(--blue)}
.badge.k-undefined{background:var(--red)}
.sl-eqn{display:flex;flex-wrap:wrap;align-items:center;gap:0 .12em;font-weight:700;font-size:1.35em;font-variant-numeric:tabular-nums;white-space:pre}
.sl-eqn .fr{font-size:.75em}

.sl-chal{border-color:var(--gold);border-width:3px;background:var(--gold-tint)}
.sl-task{display:flex;align-items:center;justify-content:space-between;gap:.5em;font-weight:700}
.sl-target{flex:none;font-size:1.8em;color:var(--ink)}
.sl-target .fr-n{border-bottom-width:.08em}
.sl-row{display:flex;gap:.5em}
.sl-row .btn{flex:1}
.sl-fb{font-weight:700;font-size:.95em;line-height:1.3}
.sl-fb:empty{display:none}
.sl-fb.good{color:var(--green)}
.sl-fb.bad{color:var(--red)}

/* a tall frame (Full screen, board) has room for a larger gradient */
@container (min-height:700px) and (orientation:landscape){
  .fr.big{font-size:3.3em}
  .big2{font-size:2.5em}
  .eqs{font-size:2.5em}
}
/* narrow or portrait tool (phone, tablet): the panel goes under the grid */
@container (max-width:680px) or (orientation:portrait){
  .tool-body{flex-direction:column}
  #side{width:auto;flex-direction:row;flex-wrap:wrap;align-content:flex-start;border-left:0;border-top:2px solid var(--ink);padding:.4em;gap:.4em;height:32%}
  #side::before,#side::after{content:none}
  .sl-card{flex:1 1 13em;padding:.35em .5em}
  .sl-big{min-height:3.4em}
  .fr.big{font-size:2em}
}
/* the panel height is fixed, so that the grid does not move under the finger when the panel text changes */
@container (max-width:680px){
  .tool-bar .ctl-label{display:none}
  #side{height:44%}
}
@container (max-width:480px){
  .tool-bar{gap:.4em;padding:.45em .5em}
  .tool-bar .btn{padding:0 .55em}
  .sl-rr{display:none}
}
