/* ═══ THE USER MANUAL — js/guide.js ════════════════════════════════════════════
   Agreed on _prototype-guide.html, 3 Oct 2026: a sheet in the middle of the app, mostly solid
   (82% with a blur, "its too transparent" at 50%), the app only faintly behind; contents down the
   left, 176px ("this sidebar too wide"); one reading column of 720px; real photographs with red
   numbered markers; the key under each photo in one column; procedures one under another.
   The app's four sizes only: 28 · 19 · 15 · 13. ═══ */

/* the button on the top bar, and its red dot when the manual has been revised */
.tb-guide{position:relative}
.tb-guide[hidden]{display:none!important}
.tb-guide .tb-gdot{position:absolute;top:6px;right:6px;width:7px;height:7px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 2px var(--surface)}
.tb-guide .tb-gdot[hidden]{display:none}
.tb-guide.on{color:var(--ink);background:var(--field)}

/* the sheet, in the middle */
.g-ov{position:fixed;inset:0;z-index:8000}
.g-ov[hidden]{display:none}
.g-scrim{position:absolute;inset:0;background:rgba(20,20,18,.12);opacity:0;transition:opacity .18s ease}
.g-sheet{position:absolute;left:50%;top:50%;width:min(1080px,calc(100vw - 64px));height:min(880px,calc(100vh - 64px));
  background:color-mix(in srgb,var(--surface) 82%,transparent);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
  border:1px solid color-mix(in srgb,var(--surface) 70%,transparent);border-radius:12px;box-shadow:0 30px 80px -24px rgba(0,0,0,.5);
  display:flex;flex-direction:column;overflow:hidden;transform:translate(-50%,-48%) scale(.985);opacity:0;
  transition:transform .2s cubic-bezier(.2,.8,.2,1),opacity .16s ease;font-family:'Inter',sans-serif;color:var(--ink)}
.g-ov.in .g-scrim{opacity:1}
.g-ov.in .g-sheet{transform:translate(-50%,-50%);opacity:1}
@media (prefers-reduced-motion:reduce){.g-sheet,.g-scrim{transition:none}}
.g-sh-head{display:flex;align-items:center;gap:14px;padding:12px 14px 12px 22px;border-bottom:1px solid color-mix(in srgb,var(--rule) 70%,transparent)}
.g-sh-t{display:flex;align-items:center;gap:10px;font-size:15px;font-weight:600;color:var(--ink);text-decoration:none}
.g-sh-t img{width:22px;height:22px;object-fit:contain}
.g-sh-ed{font-size:13px;color:var(--ink-faint)}
.g-find{margin-left:auto;display:flex;align-items:center;gap:8px;background:color-mix(in srgb,var(--field) 70%,transparent);border-radius:8px;padding:0 10px;height:34px;width:260px;color:var(--ink-faint)}
.g-find .hi{width:16px;height:16px}
.g-find input{border:0;background:none;outline:none;font:400 15px 'Inter',sans-serif;color:var(--ink);width:100%;min-width:0}
.g-lang{display:inline-flex;gap:2px;padding:2px;border-radius:8px;background:color-mix(in srgb,var(--field) 80%,transparent)}
.g-lang button{border:0;background:none;border-radius:6px;padding:5px 9px;font:600 13px 'Inter',sans-serif;color:var(--ink-soft);cursor:pointer}
.g-lang button.on{background:var(--ink);color:var(--on-ink,#fff)}
.g-x{border:0;background:none;cursor:pointer;color:var(--ink-soft);width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center}
@media (hover:hover){.g-x:hover{background:var(--field)}}
.g-sh-body{flex:1;min-height:0;display:flex}

/* contents: plain numbered lines, the chapter being read marked by a thin rule */
.g-toc{width:176px;flex-shrink:0;border-right:1px solid color-mix(in srgb,var(--rule) 70%,transparent);overflow-y:auto;padding:20px 0 40px}
.g-toc-h{font-size:13px;color:var(--ink-faint);padding:0 16px 8px}
.g-toc-row{display:flex;align-items:baseline;gap:8px;padding:5px 14px 5px 12px;font-size:13px;color:var(--ink-soft);text-decoration:none;border-left:2px solid transparent}
.g-toc-row .g-n{width:16px;flex-shrink:0;color:var(--ink-faint);font-variant-numeric:tabular-nums;text-align:right}
.g-toc-row .g-rdot{align-self:center;margin-left:auto}
@media (hover:hover){.g-toc-row:hover{color:var(--ink)}}
.g-toc-row.on{color:var(--ink);font-weight:600;border-left-color:var(--ink)}
.g-rdot{width:7px;height:7px;border-radius:50%;background:var(--accent);display:inline-block;flex-shrink:0}

/* the document: one reading column */
.g-doc{flex:1;min-width:0;overflow-y:auto;padding:0 40px}
.g-ch{max-width:720px;margin:0 auto;padding:56px 0 60px;border-bottom:1px solid var(--rule)}
.g-end{height:30vh}
.g-p{font-size:15px;line-height:1.6;margin:0;color:var(--ink)}
.g-p + .g-p{margin-top:8px}
.g-p b,.g-steps b,.g-key b,.g-perm b{font-weight:600}
.g-faint{color:var(--ink-faint)}
.g-red{color:var(--accent)}
.g-link{color:var(--ink);font-weight:600;text-decoration:underline;text-underline-offset:3px}
.g-ch-open{display:flex;gap:18px;align-items:flex-start;margin-bottom:4px}
.g-ch-open img{width:64px;height:64px;object-fit:contain;flex-shrink:0}
.g-ch-n{font-size:13px;color:var(--ink-faint);font-variant-numeric:tabular-nums}
.g-sheet .g-ch-t{font-size:28px;font-weight:500;letter-spacing:-.02em;margin:2px 0 0;line-height:1.2}
.g-lead{font-size:15px;line-height:1.55;color:var(--ink-soft);margin:8px 0 0}
.g-h3{font-size:19px;font-weight:500;letter-spacing:-.01em;margin:44px 0 14px;display:flex;gap:12px;align-items:baseline}
.g-h4{font-size:15px;font-weight:600;margin:0 0 8px;display:flex;gap:10px;align-items:baseline;line-height:1.35}
.g-sn{font-size:13px;font-weight:500;color:var(--ink-faint);font-variant-numeric:tabular-nums;flex-shrink:0}

/* the photographs */
.g-shot{margin:0 0 6px}
.g-shot-frame{position:relative;overflow:hidden;border-radius:10px;border:1px solid var(--rule);background:var(--ground);
  box-shadow:0 1px 2px rgba(0,0,0,.04),0 12px 32px -18px rgba(0,0,0,.28)}
.g-shot-frame img{position:absolute;max-width:none;display:block;height:auto}
.g-shot figcaption{font-size:13px;color:var(--ink-faint);margin-top:10px}
.g-phones{display:flex;gap:18px;flex-wrap:wrap;align-items:flex-start;margin-bottom:6px}
.g-shot-phone{margin:0;width:210px}
.g-phone{position:relative;overflow:hidden;border-radius:18px;border:1px solid var(--rule);background:var(--ground)}
.g-phone img{display:block;width:100%;height:100%;object-fit:cover}
.g-shot-bar{margin-bottom:22px}
.g-shot-bar .g-shot-frame{border-radius:8px}
.g-mk-row{position:relative;height:30px}
.g-mk-row .g-mk{top:16px}
/* the markers: the app's red, a white ring so they read on any part of the picture */
.g-mk{position:absolute;transform:translate(-50%,-50%);width:22px;height:22px;border-radius:50%;background:var(--accent);color:#fff;
  font:600 12px/22px 'Inter',sans-serif;text-align:center;box-shadow:0 0 0 2px #fff,0 2px 6px rgba(0,0,0,.25);font-variant-numeric:tabular-nums;z-index:2}
.g-mk-static{position:static;transform:none;flex-shrink:0;margin-top:1px;box-shadow:none}
.g-mk-none{width:22px;flex-shrink:0}
.g-close{display:none}

/* the key under a picture: one column — a marker, the name, what it is */
.g-key{list-style:none;margin:18px 0 0;padding:0;border-top:1px solid var(--rule)}
.g-key li{display:flex;gap:14px;align-items:flex-start;padding:11px 0;border-bottom:1px solid var(--rule-soft);font-size:15px;line-height:1.5}
.g-key li > .g-mk{color:#fff}
.g-key li div{display:grid;grid-template-columns:170px 1fr;gap:16px;flex:1;min-width:0}
.g-key li div > span{color:var(--ink-soft)}

/* other controls and notes: one column, an icon beside each */
.g-list{display:flex;flex-direction:column;gap:22px}
.g-notes{display:flex;flex-direction:column;gap:14px}
.g-note,.g-item{display:flex;gap:14px;align-items:flex-start}
.g-item .g-h4{margin:6px 0 4px}
.g-note .g-p{padding-top:6px}
.g-ic{width:34px;height:34px;border-radius:8px;background:var(--field);display:flex;align-items:center;justify-content:center;color:var(--ink-soft);flex-shrink:0}
.g-ic .hi{width:18px;height:18px}

/* procedures one under another, each a numbered block */
.g-procs{display:flex;flex-direction:column;gap:26px}
.g-steps{list-style:none;counter-reset:st;margin:0;padding:0}
.g-steps li{counter-increment:st;position:relative;padding:4px 0 4px 32px;font-size:15px;line-height:1.5}
.g-steps li::before{content:counter(st);position:absolute;left:0;top:5px;width:20px;height:20px;border-radius:50%;background:var(--field);
  font:600 11px/20px 'Inter',sans-serif;text-align:center;color:var(--ink)}

/* permissions */
.g-perms{margin-top:28px;border-top:1px solid var(--rule)}
.g-perm{display:grid;grid-template-columns:24px 220px 1fr;gap:12px;padding:12px 0;border-bottom:1px solid var(--rule-soft);font-size:15px;line-height:1.5;align-items:start}
.g-perm-ic{color:var(--good);padding-top:1px}
.g-perm-ic .hi{width:18px;height:18px}
.g-perm > span:last-child{color:var(--ink-soft)}

/* revision notice */
.g-revs{margin:24px 0 18px;border-top:1px solid var(--rule)}
.g-rev{display:flex;align-items:center;gap:14px;padding:12px 0;border-bottom:1px solid var(--rule-soft);text-decoration:none;color:var(--ink)}
.g-rev img{width:40px;height:40px;object-fit:contain}
.g-rev-ic{width:40px;height:40px;display:flex;align-items:center;justify-content:center;color:var(--good)}
.g-rev span:nth-child(2){flex:1;display:flex;flex-direction:column;font-size:15px}
.g-rev small{font-size:13px;color:var(--ink-faint)}
.g-rev > .hi{width:16px;height:16px;color:var(--ink-faint)}

/* glossary: two columns of letters */
.g-az{columns:2;column-gap:40px;margin-top:28px}
.g-az-g{break-inside:avoid;margin-bottom:22px}
.g-az-l{font-size:19px;font-weight:500;padding-bottom:6px;border-bottom:2px solid var(--ink);margin-bottom:2px}
.g-az-row{display:block;padding:9px 0;border-bottom:1px solid var(--rule-soft);text-decoration:none;color:var(--ink);font-size:15px;line-height:1.45}
.g-az-row b{font-weight:600;display:block}
.g-az-d{display:block;color:var(--ink-soft)}
.g-az-c{display:block;font-size:13px;color:var(--ink-faint);margin-top:2px}
@media (hover:hover){.g-az-row:hover b{text-decoration:underline;text-underline-offset:3px}}

/* phone: the whole screen, no contents column, a closer crop of each photo */
@media (max-width:760px){
  .g-sheet{width:calc(100vw - 16px);height:calc(100dvh - 16px)}
  .g-sh-head{padding:8px 8px 8px 14px;gap:8px}
  .g-sh-t{font-size:0;gap:0}
  .g-sh-ed{display:none}
  .g-find{width:auto;flex:1}
  .g-toc{display:none}
  .g-doc{padding:0 16px}
  .g-ch{padding:36px 0 40px}
  .g-ch-open img{width:52px;height:52px}
  .g-sheet .g-ch-t{font-size:23px}
  .g-key li div{grid-template-columns:1fr;gap:2px}
  .g-perm{grid-template-columns:24px 1fr}
  .g-perm > span:last-child{grid-column:2}
  .g-az{columns:1}
  .g-mk{width:18px;height:18px;font-size:10px;line-height:18px}
  .g-wide{display:none}
  .g-close{display:block}
}
/* the sections measure their place from the document itself (guide.js goTo) */
.g-doc{position:relative}

/* phone: the app's phone styles shrink every h2 to body size — a chapter title keeps its own.
   The laptop top bar is not on a phone at all, so its photo is left out there and its parts are
   simply listed. */
@media (max-width:760px){
  .g-sheet .g-ch-t{font-size:23px!important;font-weight:500!important;line-height:1.2!important}
  .g-shot-bar,.g-shot-bar + .g-key .g-mk{display:none}
  .g-shot-bar + .g-key{margin-top:0}
}
