/* Ruler */
#tool{--plastic:rgba(31,111,209,.12)}
/* Ink lines keep their width when the magnifier shows them bigger; --lw makes them a little bolder there.
   A real wire (the paper clip) is .phys: it gets thicker in the magnifier, as it does under a real glass. */
#world *{vector-effect:non-scaling-stroke}
#world .phys{vector-effect:none}
/* the same for the <use> copies in the magnifier, whose shadow trees start at these elements */
.r-thing *,#rl-rbody,#rl-ticks *,#rl-guides *{vector-effect:non-scaling-stroke}
.r-thing .phys{vector-effect:none}
/* the shadow of an object is its shape in ink (the group is drawn at a low opacity) */
.r-shadow [fill]:not([fill=none]):not([fill=transparent]){fill:var(--ink)}
.r-shadow [stroke]:not([stroke=none]):not([stroke=transparent]){stroke:var(--ink)}
.r-ruler{cursor:grab;outline:none}
.r-ruler.is-drag{cursor:grabbing}
.r-handle{cursor:alias}
.r-ruler.is-turn .r-knob{fill:#154f96}
.r-thing{cursor:grab;outline:none}
.r-thing.is-drag{cursor:grabbing}
.r-grips [data-grab]{cursor:move}
.r-gripring{opacity:0;transition:opacity .15s}
.r-grip:hover .r-gripring,.r-grips[data-active=a] [data-end-grip=a] .r-gripring,.r-grips[data-active=b] [data-end-grip=b] .r-gripring{opacity:.7}
@media (hover:none){.r-grip:hover .r-gripring{opacity:0}}
.r-glass{cursor:pointer}
/* one turn handle shows: past the far end, or past the start when the far end is off the stage */
.r-ruler[data-handle=l] .r-handle-r,.r-ruler:not([data-handle=l]) .r-handle-l{display:none}
/* keyboard focus: a blue glow (an outline on a turned SVG group is drawn as a wrong, large box) */
#pic [tabindex]:focus-visible{outline:none;filter:drop-shadow(0 0 2px var(--blue)) drop-shadow(0 0 3px var(--blue))}

#side{width:17em;gap:.6em}
#side::before,#side::after{content:"";margin:auto}
.rl-card{display:flex;flex-direction:column;gap:.45em;padding:.55em .6em;border:2px solid var(--ink);border-radius:.8em;background:#fff}
.rl-head{margin:0;font:600 .82em var(--font-head);color:var(--soft)}
.rl-card .seg{display:flex}
.rl-card .seg .btn{flex:1 1 auto;padding:0 .5em}
.rl-turn{display:flex;gap:.4em}
.rl-turn .btn:nth-child(2){flex:1;padding:0 .5em}
.rl-ticon{width:1.45em;height:1.45em;flex:none}
.rl-out{display:flex;flex-direction:column;justify-content:center;height:5.4em;padding:.3em .2em 0;border-top:2px solid var(--grid-strong)}
.rl-name,.rl-sub{margin:0;font:600 .82em/1.25 var(--font-head);color:var(--soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rl-big{margin:0;font:700 2.3em/1.15 var(--font-head);color:var(--red);font-variant-numeric:tabular-nums;white-space:nowrap}
.rl-big.hidden{color:var(--soft)}
.rl-sub{font-variant-numeric:tabular-nums}

/* tablet and phone: the panel goes under the bar, above the stage, so that no button is on the bottom edge */
@container (max-width:900px){
  .tool-body{flex-direction:column-reverse}
  #side{width:auto;flex:none;flex-direction:row;align-items:stretch;border-left:0;border-bottom:2px solid var(--ink);padding:.5em;overflow:hidden}
  #side::before,#side::after{content:none}
  .rl-card{flex:1 1 0;min-width:0}
  .rl-ans{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:.45em .6em}
  .rl-ans .seg{grid-column:1/-1;grid-row:2}
  .rl-out{grid-column:2;grid-row:1;height:2.7em;border-top:0;padding:0}
  .rl-big{font-size:1.5em}
  .rl-sub{display:none}
}
@container (max-width:560px){
  .tool-bar{gap:.45em .5em;padding:.45em .5em}
  .tool-bar .ctl-label{display:none}
  .tool-bar .btn,.rl-card .btn:not(.icon){padding:0 .6em}
  .tool-bar .spacer{display:none}
  .tool-bar>*{order:5}
  .tool-bar>:first-child{order:1}
  #rl-new{order:2}
  #rl-reset{order:3}
  #side{flex-direction:column;padding:.4em .5em;gap:.4em}
  .rl-card{flex:none;border:0;padding:0;border-radius:0;gap:.4em}
  .rl-card:first-child{display:grid;grid-template-columns:auto 1fr;gap:.4em}
  .rl-card:first-child .rl-head{display:none}
  .rl-card:first-child .rl-turn{grid-column:1/-1}
  .rl-ans{padding-top:.4em;border-top:2px solid var(--grid-strong)}
}
