/* openWeb3 guide: a second layer above the tool (owner's decisions, 12 and 14 Nov 2026).
   Layer one is the tool: index.html's <main>, style.css, shell.js. Nothing here restyles it.
   The rules that name a tool element give it an anchor name or a scroll margin; neither draws
   anything nor moves a box. Everything the guide draws is position:absolute or position:fixed,
   so it takes no room in the tool's text flow. Colours other than --ice come from style.css. */
:root{--ice:#cfe6ff;--ice-ink:#0d0f0b;--g-r:8px}

/* where the guide looks */
#opts{anchor-name:--g-opts}
.opt.next{anchor-name:--g-next}
#opts .opt:nth-child(2){anchor-name:--g-c2}
#opts .opt:nth-child(3){anchor-name:--g-c3}

/* The tool scrolls its row of buttons to the window's bottom edge after each command. This leaves
   room under the row for the shape and keeps the corner control off the tool's buttons and input. */
#opts,#log > :last-child{scroll-margin-bottom:76px}
@media (pointer:coarse),(max-width:700px){#opts,#log > :last-child{scroll-margin-bottom:200px}}

/* the shape: one filled rounded rectangle under the row; it never catches a click */
.g-layer{display:contents}
.g-call,.g-tick{position:absolute;z-index:101;pointer-events:none}
.g-call{anchor-name:--g-call}
.g-call{
  top:calc(anchor(--g-opts bottom) + 14px);left:anchor(--g-next left);
  max-width:calc(100vw - 2 * var(--edge));margin:0;padding:0.2em 1.6ch;
  border:1px solid var(--ice);border-radius:var(--g-r);background:var(--ice);color:var(--ice-ink);
  font-weight:700;line-height:1.5;
}
/* pointer up to the marked button */
.g-notch::before{
  content:'';position:absolute;top:-6px;left:2.2ch;width:10px;height:10px;background:inherit;
  border-top:1px solid var(--ice);border-left:1px solid var(--ice);transform:rotate(45deg);
}
/* the publish step points at the row's second button; where nothing can be pointed at (the row
   wraps, or the step has no button) the shape starts at the row's left edge and has no pointer */
.g-2{left:anchor(--g-c2 left)}
.g-plain{left:anchor(--g-opts left)}
/* three equal choices (the networks): the shape starts under the first, with a pointer under each */
.g-tick{top:calc(anchor(--g-opts bottom) + 9px);width:10px;height:10px;margin-left:-5px;background:var(--ice);transform:rotate(45deg)}
.g-tick:nth-of-type(1){left:anchor(--g-next center)}
.g-tick:nth-of-type(2){left:anchor(--g-c2 center)}
.g-tick:nth-of-type(3){left:anchor(--g-c3 center)}
/* ponytail: no shape in a browser without CSS anchor positioning (the corner control and its
   explanation still work); place the shape from guide.js if such a browser has to be covered. */
@supports not (anchor-name:--g){.g-call,.g-tick{display:none}}

/* corner control: "?" and "guide", fixed bottom right */
.g-corner{position:fixed;right:var(--edge);bottom:16px;z-index:101;display:flex;align-items:center;gap:1.2ch}
.g-toggle{display:inline-flex;align-items:center;gap:1ch;margin:0;padding:0.3em 1.4ch;border:1px solid var(--border2);border-radius:var(--g-r);background:var(--bg);cursor:pointer;color:var(--muted);font:inherit;font-size:0.8125rem;letter-spacing:inherit}
.g-toggle::before{content:'';width:0.55em;height:0.55em;border:1px solid var(--dim);border-radius:50%}
.g-toggle[aria-pressed="true"]{color:var(--text)}
.g-toggle[aria-pressed="true"]::before{border-color:var(--ice);background:var(--ice)}
.g-q{width:1.9em;height:1.9em;margin:0;padding:0;border:1px solid var(--border2);border-radius:50%;background:var(--bg);cursor:pointer;color:var(--muted);font:inherit;font-size:0.8125rem;line-height:1}
.g-q[aria-expanded="true"]{color:var(--ice);border-color:var(--ice)}
.g-toggle:hover,.g-toggle:focus-visible,.g-q:hover,.g-q:focus-visible{border-color:var(--ice);color:var(--text)}
.g-tip{position:fixed;right:var(--edge);bottom:64px;z-index:101;max-width:min(36ch,calc(100vw - 2 * var(--edge)));margin:0;padding:0.7em 2ch;border:1px solid var(--ice);border-radius:var(--g-r);background:#12160f;color:var(--text);font-size:0.875rem}
/* while the tool asks a question or waits on the wallet, the guide stays out of it */
.g-inert{opacity:0.4}
.g-corner button:disabled{cursor:not-allowed}
@media (pointer:coarse){.g-toggle{min-height:44px}.g-q{width:44px;height:44px}.g-tip{bottom:76px}}
/* Small and touch screens (seen on a real iPhone, 14 Nov 2026: a control fixed in the window's corner lay on the
   shape and on the tool's text). There the control and its explanation leave the window's corner: they sit in the
   empty band under the row, below the shape, and scroll with the page. Nothing of the guide lies on the tool. */
@supports (anchor-name:--g){
  @media (pointer:coarse),(max-width:700px){
    .g-corner{position:absolute;anchor-name:--g-corner;bottom:auto;top:calc(anchor(--g-call bottom) + 10px);right:var(--edge)}
    .g-corner.g-solo{top:calc(anchor(--g-opts bottom) + 12px)}
    .g-tip{position:absolute;bottom:auto;top:calc(anchor(--g-corner bottom) + 8px);right:var(--edge)}
  }
}
