/* Shell + shared tokens (Tactile palette). Only file allowed bare element selectors. Shell classes: gb- */
:root{
  --gb-body:#dcd8d1; --gb-body-hi:#e9e6e0; --gb-body-lo:#c8c3bb; --gb-letterbox:#d3cec6;
  --gb-ink:#26241f; --gb-ink2:#6f6a61; --gb-ink3:#9c968c;
  --gb-or:#ff5f1f; --gb-or-d:#c2420b; --gb-bl:#3a66ff; --gb-bl-d:#2140b8;
  --gb-ye:#ffc21f; --gb-ye-d:#c38c00; --gb-gr:#18b56f; --gb-gr-d:#0c7d4b;
  --gb-vi:#7b5cff; --gb-red:#ff3b2f; --gb-pk:#ff5c9a; --gb-cy:#13b0cf; --gb-br:#c98a3c; --gb-gy:#55524b;
  --gb-glass:#101215;
  --gb-sans:-apple-system,"SF Pro Text","SF Pro",system-ui,"Inter","Helvetica Neue",Arial,sans-serif;
  --gb-mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,"DejaVu Sans Mono",monospace;
  --gb-ease:cubic-bezier(.2,.8,.2,1); --gb-spring:cubic-bezier(.28,1.9,.5,1);
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0;width:100%;height:100%;overflow:hidden;background:var(--gb-letterbox);
  overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
html{position:fixed;inset:0}
/* iOS 26 home-screen apps (viewport-fit=cover + black-translucent status bar) get a viewport one status bar short and
   don't paint below it (WebKit 301108). A document at least as tall as the screen gets the full viewport; the lvh cap
   keeps it from ever growing past the screen. Standalone only; a no-op where iOS already reports the full height. */
@media (display-mode: standalone){
  html{position:relative;inset:auto;height:auto;min-height:min(100lvh,calc(100% + env(safe-area-inset-top,0px)))}
}
body{position:fixed;inset:0;font-family:var(--gb-sans);color:var(--gb-ink);-webkit-font-smoothing:antialiased;
  touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;
  background:radial-gradient(120% 80% at 20% 0%,#e3dfd8 0%,var(--gb-letterbox) 60%)}
button{font:inherit;color:inherit}
input,textarea,[contenteditable="true"]{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;font-size:16px;touch-action:manipulation}
img,svg{-webkit-user-drag:none;user-drag:none}

/* stage: shell.js sizes each stage to the FULL viewport in design px and sets one transform (scale, plus a 90deg
   rotation when the other layout is forced). Both stages stay in place and composited, so both keep their tiles.
   The off-screen transform below only applies before the first layout. A switch toggles .gb-clip on the upper
   stage and runs a WAAPI translate settle + the cover's veil (compositor only). */
.gb-app{position:fixed;inset:0;overflow:hidden;contain:strict}
.gb-stage{position:absolute;left:0;top:0;width:428px;height:926px;transform-origin:0 0;will-change:transform;contain:strict;transform:translate(-30000px,0)}
/* fixed stacking, never changed (a z-index or opacity change on a stage repaints every composited layer in it:
   WebKit RepaintLayer). The landscape stage is the upper one; while portrait shows, it is clipped to nothing:
   a clip-path change is a recomposite (0 layers repainted, its tiles stay) and clip-path also stops hit testing. */
#gb-stage-portrait{z-index:0}#gb-stage-landscape{z-index:1}
.gb-stage.gb-clip{clip-path:inset(0px 0px 100% 0px)}
.gb-screen{position:absolute;left:0;top:0;width:100%;height:100%;display:block;overflow:hidden;contain:layout paint style}
.gb-cover{position:absolute;inset:0;z-index:2;opacity:0;pointer-events:none;will-change:opacity;
  background:radial-gradient(130% 70% at 25% 0%,#e7e4de 0%,#dcd8d1 45%,#d2cdc5 100%)}
/* safe-area probe: shell.js reads its padding. Test mode overrides with --gb-sat/--gb-sar/--gb-sab/--gb-sal on <html>. */
.gb-probe{position:fixed;left:0;top:0;width:0;height:0;visibility:hidden;pointer-events:none;
  padding:var(--gb-sat,env(safe-area-inset-top,0px)) var(--gb-sar,env(safe-area-inset-right,0px)) var(--gb-sab,env(safe-area-inset-bottom,0px)) var(--gb-sal,env(safe-area-inset-left,0px))}
/* scroll areas inside screens opt in with class gb-scroll (or data-scroll) */
.gb-scroll{overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;touch-action:pan-y}

/* placeholder shown when a screen script is missing or failed to mount */
.gb-ph{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;
  background:radial-gradient(130% 70% at 25% 0%,#e7e4de 0%,#dcd8d1 45%,#d2cdc5 100%);color:var(--gb-ink2);text-align:center;padding:40px}
.gb-ph-knob{width:84px;height:84px;border-radius:50%;position:relative;
  background:radial-gradient(circle at 38% 32%,#f6f4f0 0%,#d9d5ce 55%,#b9b3a9 100%);
  box-shadow:inset 0 1px 0 #fff,0 10px 18px -8px rgba(60,48,36,.55),0 0 0 6px #3a3833,0 0 0 7px rgba(255,255,255,.35)}
.gb-ph-knob::after{content:"";position:absolute;left:50%;top:10px;width:5px;height:26px;margin-left:-2.5px;border-radius:3px;background:var(--gb-or);
  transform-origin:50% 32px;transform:rotate(30deg);box-shadow:0 0 8px rgba(255,95,31,.6);animation:gb-ph-turn 2.4s var(--gb-ease) infinite alternate}
.gb-ph b{font:700 22px/1 var(--gb-sans);letter-spacing:-.02em;color:var(--gb-ink)}
.gb-ph span{font:500 14px/1.45 var(--gb-sans);max-width:260px}
@keyframes gb-ph-turn{from{transform:rotate(-40deg)}to{transform:rotate(60deg)}}

/* boot cover: fades out once the screens are mounted */
.gb-boot{position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;
  background:radial-gradient(120% 80% at 20% 0%,#e7e4de 0%,#d6d1c9 70%);transition:opacity .45s var(--gb-ease),visibility 0s .5s}
.gb-boot.gb-gone{opacity:0;visibility:hidden;pointer-events:none}
.gb-boot-knob{width:64px;height:64px;border-radius:50%;position:relative;
  background:radial-gradient(circle at 38% 32%,#f6f4f0 0%,#d9d5ce 55%,#b9b3a9 100%);
  box-shadow:inset 0 1px 0 #fff,0 8px 14px -6px rgba(60,48,36,.5),0 0 0 5px #3a3833}
.gb-boot-knob i{position:absolute;left:50%;top:7px;width:4px;height:20px;margin-left:-2px;border-radius:2px;background:var(--gb-or);transform-origin:50% 25px;transform:rotate(30deg)}
.gb-boot-name{font:800 15px/1 var(--gb-mono);letter-spacing:.24em;color:var(--gb-ink2)}

@media (prefers-reduced-motion:reduce){
  .gb-ph-knob::after{animation:none}
}

/* no text selection / magnifier anywhere except real text fields */
*:not(input):not(textarea):not([contenteditable="true"]){-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}
