.pass-guide {
  --guide-pad: clamp(16px, 4vw, 26px);
  width: min(526px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #aeb19e;
  border-radius: 16px;
  background: #fffef9;
  color: var(--ink);
  box-shadow: 0 24px 75px #1f271c40, 0 3px 0 #d4d2c1;
}
.pass-guide[open] { display: flex; flex-direction: column; }
.pass-guide::backdrop { background: #20261973; }
body:has(.pass-guide[open]) { overflow: hidden; }

.pass-guide-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 75px;
  padding: 13px var(--guide-pad);
  border-bottom: 1px dashed #c3b69a;
  background: linear-gradient(#faf0dbcf, #faf0dbcf), var(--paper) url("./assets/paper.png") repeat;
}
.guide-book {
  flex: none;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid #203b9e;
  border-radius: 6px;
  background: var(--blue);
  color: #fffaf0;
  transform: rotate(-6deg);
}
.guide-book .icon { width: 21px; height: 21px; }
.pass-guide h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 780;
  line-height: 1.35;
  letter-spacing: -.055em;
}
.guide-dismiss {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0 -7px 0 auto;
  border: none;
  border-radius: 50%;
  background: transparent;
}
.guide-dismiss .icon { width: 19px; height: 19px; }
.pass-guide-body {
  flex: 0 1 auto;
  min-height: 0;
  padding: 3px var(--guide-pad);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.pass-guide-steps { list-style: none; margin: 0; padding: 0; }
.guide-step {
  display: grid;
  grid-template-columns: 98px minmax(0,1fr);
  gap: 17px;
  align-items: center;
  padding-block: 17px;
}
.guide-step + .guide-step { border-top: 1px solid #e1e0d5; }
.guide-instruction h3 {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 730;
  letter-spacing: -.025em;
  line-height: 1.4;
}
.guide-instruction a {
  display: inline;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: #b5c0e4;
  text-underline-offset: 3px;
}
.guide-instruction a .icon {
  width: 13px;
  height: 13px;
  margin-left: 4px;
  vertical-align: -.05em;
}
.guide-instruction p { margin: 0; color: #565b50; font-size: 14px; line-height: 1.65; }
.guide-instruction strong { font-weight: 680; color: #353b30; }
.pass-guide-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  padding: 14px var(--guide-pad) max(16px, env(safe-area-inset-bottom));
  border-top: 1px dashed #c9c6b4;
}
.guide-start {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 9px 16px;
  border: 1px solid #223ea4;
  border-radius: 7px;
  background: var(--blue);
  box-shadow: 0 2px 0 #183389;
  font-size: 14px;
  font-weight: 650;
  color: white;
}
.guide-start .icon { width: 17px; height: 17px; }
.pass-guide a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }

.copy-tip { margin-top: 4px; }
.copy-tip summary {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  padding-block: 3px;
  text-underline-offset: 3px;
}
.copy-tip summary::-webkit-details-marker { display: none; }
.copy-tip summary .icon { width: 13px; height: 13px; }
.copy-tip[open] summary .icon { transform: rotate(180deg); }
.copy-tip[open] p { border-left: 2px solid #c4cfb5; padding-left: 8px; margin-top: 4px; font-size: 13px; }
.copy-tip kbd { font: 650 .91em var(--mono); color: var(--ink); }
.copy-tip summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

/* Small printed diagrams show the page, selected address bar and pasted link. */
.guide-art {
  position: relative;
  height: 76px;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #cbc9b7;
  border-radius: 7px;
  color: #394a72;
  background-color: #f4e8ce;
}
.guide-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .35;
  background: radial-gradient(#94836a .65px, transparent .9px) 0 0 / 4px 4px;
  mask-image: radial-gradient(ellipse at 55% 55%, black 30%, transparent 78%);
}
.art-copy { background-color: #e7edf6; }
.art-paste { background-color: #eaf0db; }
.guide-no {
  position: absolute;
  left: 5px;
  top: 4px;
  color: #656652;
  font: 650 8px/1 var(--mono);
  letter-spacing: .045em;
}
.demo-window, .demo-pass {
  position: absolute;
  left: 17%;
  top: 24%;
  width: 65%;
  height: 56%;
  border: 1px solid #53617a;
  border-radius: 4px;
  background: #fffdf5;
  box-shadow: 2px 3px 0 #34486c28;
  transform: rotate(-6deg);
}
.demo-chrome {
  display: block;
  height: 19%;
  border-radius: 3px 3px 0 0;
  border-bottom: 1px solid #9da4a5;
  background: radial-gradient(circle, #758098 0 1px, transparent 1.1px) 4px center / 4px 4px repeat-x;
  background-clip: content-box;
  padding-right: calc(100% - 16px);
}
.demo-flare { position: absolute; width: 11px; height: 11px; left: 10%; top: 36%; color: var(--blue); }
.demo-button { position: absolute; width: 32%; height: 14%; bottom: 18%; right: 13%; border-radius: 2px; background: var(--blue); }
.demo-pointer {
  position: absolute;
  width: 14px;
  height: 18px;
  right: 13%;
  bottom: 13%;
  background: #e77535;
  clip-path: polygon(5% 0, 98% 58%, 61% 62%, 76% 90%, 56% 100%, 41% 71%, 13% 95%);
}
.art-copy .demo-window { transform: rotate(4deg); }
.demo-selection, .demo-fields { position: absolute; left: 9%; right: 9%; border-radius: 2px; }
.demo-selection {
  top: 12%;
  height: 23%;
  border: 1px solid #a2b1d1;
  background: linear-gradient(90deg, #bbcdf9 68%, #edf1f9 68%);
}
.demo-fields {
  top: 47%;
  height: 33%;
  background: repeating-linear-gradient(to bottom, #d5d9ce 0 2px, transparent 2px 5px);
}
.demo-clip, .demo-check {
  display: grid;
  place-items: center;
  position: absolute;
  right: 7%;
  width: 22px;
  height: 22px;
  border: 1px solid #3b465c;
  box-shadow: 1px 2px 0 #34486c26;
}
.demo-clip { top: 19%; transform: rotate(9deg); border-radius: 4px; background: #f5a361; color: #3e372a; }
.demo-clip .icon { width: 14px; height: 14px; }
.demo-pass { transform: rotate(-3deg); }
.demo-pass > .demo-flare { top: 12%; height: 9px; width: 9px; }
.demo-field {
  position: absolute;
  inset: 47% 9% 17%;
  display: flex;
  align-items: center;
  gap: 3px;
  padding-left: 2px;
  border: 1px solid #b2bc9e;
  border-radius: 2px;
  color: #53663e;
}
.demo-field .icon { width: 9px; height: 9px; }
.demo-field::after { content: ""; width: 42%; height: 2px; background: #96ab84; }
.demo-check { bottom: 12%; border-radius: 50%; background: #c6db87; color: #334633; transform: rotate(6deg); }
.demo-check .icon { width: 15px; height: 15px; stroke-width: 2.4; }

@media screen and (hover: hover) and (pointer: fine) {
  .copy-tip summary:hover { text-decoration: underline; }
  .guide-dismiss:hover { background-color: #e9dcc0; }
  .guide-start:hover { background-color: #193bab; }
  .guide-instruction a:hover { text-decoration-color: currentColor; }
  html[data-motion="playing"] .guide-step:first-child:hover .demo-pointer { transform: translate(-5px, -4px); }
  html[data-motion="playing"] .guide-start:hover .icon { transform: translateX(3px); }
}
@media screen {
  html[data-motion="playing"] .pass-guide[open] {
    opacity: 1;
    transform: none;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  }
  html[data-motion="playing"] .pass-guide[open]::backdrop {
    opacity: 1;
    transition: opacity 180ms ease;
  }
  @starting-style {
    html[data-motion="playing"] .pass-guide[open]:not([data-closing]) { opacity: 0; transform: translateY(9px) scale(.98); }
    html[data-motion="playing"] .pass-guide[open]:not([data-closing])::backdrop { opacity: 0; }
  }
  html[data-motion="playing"] .pass-guide[data-closing] {
    opacity: 0;
    transform: translateY(5px) scale(.99);
    transition-duration: 160ms;
  }
  html[data-motion="playing"] .pass-guide[data-closing]::backdrop { opacity: 0; transition-duration: 160ms; }
  html[data-motion="playing"] .guide-step:has(.copy-tip[open]) .demo-clip { transform: translate(-3px,-2px) rotate(-3deg); }
  html[data-motion="playing"] .pass-guide:has(.guide-start:focus-visible) .demo-check { transform: rotate(0) scale(1.08); }
  html[data-motion="playing"] :is(.demo-pointer,.demo-clip,.demo-check,.guide-start .icon) { transition: transform 150ms var(--ease-out); }
  html[data-motion="playing"] .guide-step:focus-within .demo-pointer { transform: translate(-5px, -4px); }
}

@media (max-width: 440px) {
  .pass-guide { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 12px; }
  .pass-guide-head { gap: 8px; min-height: 60px; padding-block: 8px; }
  .guide-book { width: 26px; height: 26px; }
  .guide-book .icon { width: 17px; height: 17px; }
  .pass-guide h2 { font-size: 19px; }
  .guide-step { grid-template-columns: 74px minmax(0, 1fr); gap: 11px; padding-block: 13px; }
  .guide-art { height: 66px; }
  .guide-instruction h3 { font-size: 15px; }
  .guide-instruction p { font-size: 13px; }
  .pass-guide-foot { padding-top: 11px; }
  .guide-start { width: 100%; min-height: 44px; }
}
@media (max-height: 420px) {
  .pass-guide { max-height: calc(100dvh - 12px); }
  .pass-guide-head { min-height: 49px; padding-block: 2px; }
  .pass-guide-foot { padding-block: 7px; }
}
