/* Shared by both demos: site tokens and the fixed bar above the demo. */
@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(../../fonts/InterVariable.woff2) format("woff2")}
:root{--demosBar:52px;--accent:#6236ff;--accent-hi:#7d5bff;--accent-lo:#4a1fe0;--accent-glow:rgb(98 54 255/.5);--accent-tint:#ebe5ff;--bg-band:#f4f4f5;--text:#09090b;--tone:#8b8b93;--rule:#e6e6e9;
  --ui:Inter,-apple-system,BlinkMacSystemFont,system-ui,"Segoe UI",sans-serif;--ease-out:cubic-bezier(.22,1,.36,1)}
html,body{height:100%}
body{box-sizing:border-box;padding-top:var(--demosBar)}
#stage{height:calc(100vh - var(--demosBar))!important;height:calc(100dvh - var(--demosBar))!important}
#demosBar{position:fixed;left:0;right:0;top:0;height:var(--demosBar);z-index:2000;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px;
  padding:0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left));
  background:rgb(255 255 255/.72);-webkit-backdrop-filter:saturate(180%) blur(16px);backdrop-filter:saturate(180%) blur(16px);border-bottom:1px solid var(--rule);
  color:var(--text);font:500 14px/1 var(--ui);letter-spacing:-.005em;-webkit-font-smoothing:antialiased}
#demosBar a{color:inherit;text-decoration:none}
.db-start{justify-self:start;display:flex;align-items:center;gap:14px;min-width:0}
.db-back{display:inline-flex;align-items:center;gap:6px;padding-right:14px;border-right:1px solid var(--rule);color:#52525b;white-space:nowrap;transition:color .16s}
.db-back:hover{color:var(--text)}
.db-back svg{width:16px;height:16px;flex:none;rotate:180deg;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.db-logo{--wm:84px;display:inline-flex;align-items:center;gap:9px}
.db-logo::before{content:"";width:var(--wm);aspect-ratio:105/20;margin-bottom:calc(var(--wm)*-.038);background:currentColor;-webkit-mask:url(/nearpay.svg) center/contain no-repeat;mask:url(/nearpay.svg) center/contain no-repeat}
.db-logo span{padding:1px 0 1px 9px;border-left:1px solid #d4d4d8;font-size:13px;font-weight:600;letter-spacing:.02em}
#chapLabel{display:flex;align-items:center;gap:10px;min-width:0;font-size:15px;font-weight:600;letter-spacing:-.01em}
#chapNum{flex:none;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:#fff;font-size:12px;font-variant-numeric:tabular-nums}
#chapTitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.db-end{justify-self:end;display:flex;align-items:center;gap:6px}
#bRestart{height:34px;padding:0 12px;border-radius:8px;font:inherit;color:#52525b;transition:color .16s,background-color .16s,transform .16s var(--ease-out)}
#bRestart:hover{color:var(--text);background:rgb(9 9 11/.04)}
#bRestart:active{transform:scale(.97)}
#demosBar :focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:8px}
/* Upright phones: chapter on its own row so the title is never cut, finger sized targets. */
@media (max-width:680px) and (orientation:portrait){
  :root{--demosBar:88px}
  #demosBar{grid-template-columns:1fr auto;grid-template-rows:52px 1fr;gap:0 10px;padding:0 max(12px,env(safe-area-inset-right)) 4px max(12px,env(safe-area-inset-left))}
  .db-logo{--wm:72px}
  .db-start{gap:10px}
  .db-back{justify-content:center;width:40px;height:40px;margin-left:-10px;padding-right:0;border-right:0}
  .db-back span{display:none}
  #chapLabel{grid-area:2/1/3/3;justify-self:center}
  #bRestart{height:40px;padding:0 10px}
}
/* Phones held sideways: a slimmer bar so the demo gets the height. Desktop never matches this. */
@media (orientation:landscape) and (max-height:500px){
  :root{--demosBar:40px}
  #bRestart{height:30px}
}
