/* Plus and Minus Charges */
/* the number sentence controls: number, operation, number, each with its label above */
.cg-build{display:inline-flex;align-items:flex-end;gap:.4em 1.1em}
.cg-build>.ctl{flex-direction:column;flex-wrap:nowrap;align-items:center;gap:.15em}
.cg-build .ctl-label{line-height:1.1}
.cg-signed{min-height:max(2.5em,44px)}
.cg-signed input{width:3.3ch}
.cg-chev{display:block;width:.95em;height:.95em;margin:auto;fill:none;stroke:currentColor;stroke-width:3.4;stroke-linecap:round;stroke-linejoin:round}
/* the operation: two round buttons, so that they do not look like the steppers */
.cg-op .seg{gap:.3em}
.cg-op .seg .btn,.cg-op .seg .btn:first-child,.cg-op .seg .btn:last-child{border-radius:50%;margin-left:0;width:max(1.9em,44px);height:max(1.9em,44px);min-height:0;padding:0;font-size:1.3em}
.cg-main{min-width:7.2em;font-size:1.08em}
.cg-optbtn,.cg-done{display:none}

/* the stage: the number sentence on top, the charges, and the line of words under them */
.cg-stage{display:flex;flex-direction:column}
.cg-head{flex:none;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.4em 1em;height:4.3em;padding:.35em .9em 0}
.cg-sum{grid-column:2;font-size:2.45em;font-weight:700;line-height:1;white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.cg-sum .ans{display:inline-block;min-width:1.5em;padding:.07em .2em .1em;border:.07em solid var(--ink);border-radius:.18em;background:#fff;text-align:center}
.cg-sum .ans.q{border-style:dashed;color:var(--soft)}
.cg-key{grid-column:1;justify-self:start;display:flex;flex-direction:column;gap:.3em;font-size:.84em;font-weight:600;color:#39424e;background:#fff;padding:.35em .7em;border-radius:.6em;border:2px solid var(--line)}
.cg-key>span{display:flex;align-items:center;gap:.45em;white-space:nowrap}
.cg-key b{color:var(--ink);font-size:1.1em}
.cg-mini{width:1.4em;height:1.4em;flex:none;display:block}
.cg-tally{grid-column:3;justify-self:end;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.3em .4em;max-height:100%;overflow:hidden}
.cg-pill{display:inline-flex;align-items:baseline;gap:.3em;padding:.15em .75em .2em;border:2px solid var(--ink);border-radius:999px;background:#fff;font-weight:600;white-space:nowrap}
.cg-pill b{font-size:1.4em;font-variant-numeric:tabular-nums}
.cg-pic{flex:1;min-height:0;position:relative}
.cg-pic>svg{position:absolute;inset:0;width:100%;height:100%;display:block}
.cg-saybox{flex:none;height:4.6em;display:flex;align-items:center;justify-content:center;padding:0 .8em .6em}
.cg-say{margin:0;max-width:60em;padding:.35em 1em .4em;background:#fff;border:2px solid var(--ink);border-radius:.7em;font:600 1.08em/1.3 var(--font-head);text-align:center;color:#2b3440;text-wrap:balance}
.cg-say:empty{visibility:hidden}
.cg-say .eq{font-weight:700;color:var(--ink);white-space:nowrap}

/* the options */
#side{width:17em;gap:.6em;padding-bottom:1.6em}
#side .ctl{flex-direction:column;align-items:flex-start;gap:.3em}
.cg-q{display:flex;flex-direction:column;gap:.5em;padding-top:.55em;border-top:2px dashed var(--line)}
#side .cg-inline .ctl{flex-direction:row;align-items:center;gap:.6em}
.cg-dots{display:inline-flex;gap:.25em}
.cg-dots .cg-mini{width:1.3em;height:1.3em}
.cg-sidekey{display:none}

/* the charges and the parts of the picture */
#pic .cg-body{stroke:var(--ink)}
#pic .cg-ring{fill:none}
#pic .cg-sign{fill:none;stroke-linecap:round}
#pic .cg-shadow{fill:var(--ink);opacity:.17}
#pic .cg-halo{fill:none;stroke:var(--gold)}
#pic .cg-label text{font-family:Lexend,Arial,sans-serif;font-weight:700;text-anchor:middle}
#pic .cg-label .lead{fill:var(--ink)}
#pic .cg-label .rest{fill:#465060;font-weight:600}
#pic .cg-burst{fill:#ffe79a;fill-opacity:.6;stroke:var(--gold)}
#pic .cg-badge circle{fill:#fff;stroke:var(--ink);stroke-width:2.5}
#pic .cg-badge text{font-family:Lexend,Arial,sans-serif;font-weight:700;text-anchor:middle;fill:var(--ink)}
#pic .cg-tbox{fill:#fff;fill-opacity:.8;stroke:#7b8694;stroke-width:2;stroke-dasharray:9 6}
#pic .cg-ghost circle{fill:#f4f7fb;stroke:#9aa6b4;stroke-width:2}
#pic .cg-ghost path{fill:none;stroke:#aeb8c4;stroke-linecap:round}
#pic .cg-cap{fill:var(--gold-tint);stroke:var(--ink);stroke-width:2}
#pic .cg-nl-line,#pic .cg-nl-arrow{fill:none;stroke:var(--ink);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
#pic .cg-nl-tick{stroke:var(--ink);stroke-width:2}
#pic .cg-nl-tick.zero{stroke-width:3.5}
#pic .cg-nl-num{font-family:Lexend,Arial,sans-serif;font-weight:600;text-anchor:middle;fill:var(--ink)}
#pic .cg-nl-mark circle{stroke:var(--ink);stroke-width:2.5}
#pic .cg-nl-val{font-family:Lexend,Arial,sans-serif;font-weight:700;text-anchor:middle;fill:var(--ink)}

/* a middle-sized tool (tablet): the stage is narrow next to the options, so the longest sentences take three lines */
@container (min-width:681px) and (max-width:1100px){.cg-saybox{height:5.9em}}
/* a narrow tool (phone): the options open over the stage, the key moves into them */
@container (max-width:680px){
  .tool-bar{gap:.45em .5em;padding:.45em}
  .cg-build{gap:.3em .4em;flex-wrap:wrap;justify-content:center}
  .cg-op .seg{gap:.2em;padding:1px 0}
  .cg-op .seg .btn,.cg-op .seg .btn:first-child,.cg-op .seg .btn:last-child{width:42px;height:42px}
  .cg-signed button{width:40px}
  .cg-signed input{width:2.9ch;min-width:0;padding:0}
  .cg-optbtn{display:inline-flex}
  .tool-body{position:relative}
  #side{display:none;position:absolute;inset:0;z-index:5;width:auto;border-left:0;padding:.8em 1em 1.6em;overflow:auto}
  #side.open{display:flex}
  .cg-done{display:inline-flex;align-self:flex-end}
  .cg-sidekey{display:block}
  .cg-sidekey .cg-key{display:inline-flex}
  .cg-head{grid-template-columns:1fr auto;height:3.2em;padding:.3em .6em 0}
  .cg-head>.cg-key{display:none}
  .cg-sum{grid-column:1;font-size:1.9em}
  .cg-tally{grid-column:2;font-size:.85em}
  .cg-tally .cg-pill:not(:last-child){display:none}
  .cg-saybox{height:6.3em;padding:0 .4em .5em}
  .cg-say{font-size:.95em;padding:.3em .6em}
}
