/* Array Maker */
.tool-body{position:relative}
.ar-step input{width:2.4ch}
.ar-count.on{background:var(--gold)}
.ar-optbtn.on{background:var(--ink);color:#fff}

/* ---------- the side panel: Turn, the words, Cover and Fact family ---------- */
#side{width:21.5em;gap:.5em;padding:.6em .6em 1.4em}
.ar-acts{flex:none;display:flex;gap:.5em}
.ar-turn{flex:1 1 auto;font-size:1.25em;min-height:max(2.2em,46px);gap:.4em;box-shadow:0 .15em 0 var(--ink);margin-bottom:.15em}
.ar-turn:active{transform:translateY(.1em);box-shadow:0 .05em 0 var(--ink)}
.ar-ticon{width:1.25em;height:1.25em;flex:none}

.ar-words{flex:none;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"rows total" "mul total" "add add";border:2px solid var(--ink);border-radius:.7em;background:#fff;overflow:hidden}
.ar-line{display:flex;align-items:center;gap:.45em;min-width:0;min-height:max(2.2em,40px);margin:0;padding:.25em .55em;border:0;border-radius:0;background:none;color:var(--ink);font:700 1.25em/1.2 var(--font-head);text-align:left;cursor:pointer;font-variant-numeric:tabular-nums;-webkit-tap-highlight-color:transparent}
.ar-line:hover{background:var(--desk)}
.ar-line:focus-visible{outline-offset:-3px}
.ar-txt{flex:1;min-width:0}
.ar-l-rows .ar-txt,.ar-l-mul .ar-txt{white-space:nowrap}
.ar-l-rows{grid-area:rows}
.ar-l-mul{grid-area:mul;display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:center;gap:0 .3em;font-size:1.6em;border-top:2px dashed var(--line);line-height:1.15}
.ar-l-mul .ar-txt{grid-column:1}
.ar-join{grid-column:1;grid-row:2;font-size:max(.56em,14px);white-space:nowrap;line-height:1.3;color:var(--blue-ink);min-height:1.3em}
.ar-l-mul .ar-eye{grid-column:2;grid-row:1/3;align-self:center;width:.68em;height:.68em}
.ar-l-total{grid-area:total;flex-direction:column;justify-content:center;gap:.05em;min-width:4.2em;padding:.2em .4em;border-left:2px solid var(--ink);background:var(--gold-tint)}
.ar-l-total:hover{background:#ffefc2}
.ar-l-total .ar-txt{flex:none;font-size:2.3em;line-height:1.05;text-align:center}
.ar-l-total .ar-txt .q{font-size:.8em}
.ar-lab{font-size:.72em;font-weight:600;color:#3d4653}
.ar-l-add{grid-area:add;border-top:2px solid var(--ink);min-height:2.9em;font-size:1.2em;line-height:1.25}
.ar-l-add .ar-txt{text-wrap:balance}
.nw{white-space:nowrap}
.ar-txt .op{color:#3d4653}
.ar-txt .q{display:inline-block;min-width:1.05em;padding:0 .1em;border:2px dashed #8a95a3;border-radius:.22em;color:var(--soft);text-align:center;line-height:1.05}
.ar-eye{flex:none;width:1.05em;height:1.05em;color:#8a95a3}
.ar-line .ar-slash{display:none}
.ar-line.hidden .ar-slash{display:inline}
.ar-line.hidden .ar-eye{color:var(--red)}

.ar-more{flex:none;display:flex;flex-wrap:wrap;gap:.45em}
.ar-more:empty{display:none}
.ar-family{display:none}
#side.ar-hasfam .ar-family{flex:none;display:flex;flex-direction:column;gap:.25em;padding:.4em .6em .45em;border:2px solid var(--ink);border-radius:.7em;background:#fff}
.ar-fhead{display:flex;justify-content:space-between;align-items:center;gap:.5em;font-weight:600;font-size:.82em;color:#3d4653}
.ar-sq{padding:.05em .55em;border:2px solid var(--ink);border-radius:999px;background:var(--gold);color:var(--ink);font-weight:700;white-space:nowrap}
.ar-fhead{flex-wrap:wrap}
.ar-facts{display:grid;grid-template-columns:1fr 1fr;gap:.2em .5em;font-weight:700;font-size:1.08em;font-variant-numeric:tabular-nums}
.ar-facts.two{grid-template-columns:auto auto;justify-content:start;column-gap:1em}
.ar-fact{padding:0 .2em;border-radius:.3em;white-space:nowrap}
.ar-fact.mark{background:var(--sun);box-shadow:0 0 0 2px var(--ink)}
.ar-share{margin:0;min-height:2.6em;font-weight:600;font-size:.86em;line-height:1.3;color:#2b3440}
.ar-share .q{font-size:.95em}

/* ---------- the options ---------- */
.ar-opts{position:absolute;z-index:20;top:0;right:0;bottom:0;width:21.5em;display:flex;flex-direction:column;align-items:flex-start;gap:.75em;padding:.7em .8em 1.6em;background:#fff;border-left:2px solid var(--ink);overflow:auto}
.ar-opts[hidden]{display:none}
.ar-opts>.ctl{flex-direction:column;align-items:flex-start;gap:.3em}
.ar-ohead{align-self:stretch;display:flex;justify-content:space-between;align-items:center;font-size:1.1em}
.ar-optslot{display:flex;flex-wrap:wrap;gap:.5em}
.ar-optslot:empty{display:none}

/* ---------- the picture ---------- */
#pic .ar-shadows{opacity:.17;transition:opacity .22s}
#pic .ar-sh rect,#pic .ar-sh circle{fill:var(--ink)}
#pic .ar-counters,#pic .ar-outline,#pic .ar-paper{transition:opacity .22s}
#pic .ar-fade{opacity:0}
#pic .ar-pop,#pic .ar-bpop,#pic .ar-tw{transform-box:fill-box;transform-origin:center}
#pic .ar-pop.in,#pic .ar-bpop.in{animation:ar-in .34s cubic-bezier(.34,1.56,.64,1) both}
#pic .ar-pop.out{animation:ar-out .2s ease-in both}
#pic .ar-pop.hop{animation:ar-hop .42s ease-out both}
#pic .ar-tw.go{animation:ar-tw .55s ease-out}
@keyframes ar-in{from{transform:scale(0)}}
@keyframes ar-out{to{transform:scale(0)}}
@keyframes ar-hop{40%{transform:translateY(-18%)}}
@keyframes ar-tw{35%{transform:scale(1.5)}}
#pic .ar-frame{stroke:var(--ink)}
#pic .ar-rings{transition:opacity .25s}
#pic .ar-rings.hide{opacity:0}
#pic .ar-band{transition:stroke .2s}
#pic .ar-ring.lit .ar-band{stroke:var(--gold)}
#pic .ar-ring.lit .ar-ringfill{fill:var(--gold-tint)}
#pic .ar-ring.now .ar-band{stroke:#ffbf1f}
#pic .ar-over .ar-ringfill{fill-opacity:0}
#pic .ar-over .ar-ring.lit .ar-ringfill{fill:var(--gold);fill-opacity:.3}
#pic .ar-badge rect{fill:#fff;stroke:var(--ink);stroke-width:2}
#pic .ar-badge.last rect{fill:var(--gold)}
#pic .ar-badge text{font-family:Lexend,Arial,sans-serif;font-weight:700;text-anchor:middle;dominant-baseline:central;fill:var(--ink)}
#pic .ar-handle{cursor:grab}
#pic.ar-dragging,#pic.ar-dragging .ar-handle{cursor:grabbing}
#pic .ar-hpulse{fill:none;stroke:var(--blue);stroke-width:3;transform-box:fill-box;transform-origin:center;animation:ar-pulse 1.8s ease-out infinite}
#pic.ar-used .ar-hpulse{display:none}
@keyframes ar-pulse{from{transform:scale(1);stroke-opacity:.8}to{transform:scale(1.9);stroke-opacity:0}}
#pic .ar-paper{cursor:grab}
#pic .ar-paper.lifted{cursor:grabbing}
@media (prefers-reduced-motion:reduce){
  #pic .ar-pop.in,#pic .ar-bpop.in,#pic .ar-pop.out,#pic .ar-pop.hop,#pic .ar-tw.go{animation:none}
  #pic .ar-hpulse{display:none}
}

/* ---------- a tall tool (tablet, phone): the words go under the picture ---------- */
@container (orientation:portrait){
  .tool-body{flex-direction:column}
  #side{width:auto;flex:none;display:grid;grid-template-columns:12.5em minmax(0,1fr) auto;grid-template-rows:auto 1fr;grid-template-areas:"acts words fam" "more words fam";
    align-items:start;gap:.5em .7em;border-left:0;border-top:2px solid var(--ink);padding:.6em .7em 1.4em;overflow:visible}
  .ar-acts{grid-area:acts}
  .ar-words{grid-area:words}
  .ar-more{grid-area:more;flex-direction:column;align-items:stretch}
  #side.ar-hasfam .ar-family{grid-area:fam;width:16.5em}
  /* a fixed height, so that the picture keeps its size while the words change */
  #side{height:12.9em}
  #side.ar-hasfam{height:14.5em}
  .ar-facts.two{grid-template-columns:auto}
  .ar-opts{border-top:2px solid var(--ink)}
}
/* ---------- a narrow tool (phone) ---------- */
@container (max-width:680px){
  .tool-bar{column-gap:.5em;padding:.45em}
  .tool-bar .btn{padding:0 .6em}
  .tool-bar .stepper input{min-width:0;width:2.2ch}
  .tool-bar .stepper button{width:40px}
  .tool-bar .ctl{gap:.3em}
  .tool-body{flex-direction:column}
  #side{width:auto;display:flex;flex-direction:column;align-items:stretch;gap:.4em;padding:.45em .45em 1.3em;border-left:0;border-top:2px solid var(--ink)}
  .ar-acts .btn{padding:0 .7em}
  .ar-acts .ar-turn{font-size:1.2em}
  .ar-line{min-height:40px;padding:.15em .5em}
  .ar-l-rows{font-size:1.15em}
  .ar-l-mul{font-size:1.45em}
  .ar-l-add{font-size:1.05em;min-height:2.75em}
  .ar-l-total .ar-txt{font-size:2.1em}
  /* the fact family in two short lines and the sharing sentence; the heading only for a square number */
  #side{height:15.1em}
  #side.ar-hasfam{height:20.3em}
  #side.ar-hasfam .ar-family{width:auto;padding:.25em .5em .3em;gap:.1em}
  .ar-fhead>span:first-child{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .ar-fhead:not(:has(.ar-sq)){display:none}
  .ar-facts{font-size:1em}
  .ar-facts.two{grid-template-columns:auto auto}
  .ar-share{min-height:1.3em;font-size:.84em}
  .ar-opts{inset:0;width:auto;border:0}
}
