/* Pathfinder website only (not used by the desktop app). */
.gtw-pick{position:fixed;inset:0;z-index:100000;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;padding:16px}
.gtw-pick>div{background:var(--g-solid,#171a24);border:1px solid var(--g-line,#2b2e33);border-radius:10px;padding:18px;display:flex;flex-direction:column;gap:12px;min-width:min(320px,100%);color:#fff}
.gtw-pick label{display:inline-flex;justify-content:center;padding:10px 14px;cursor:pointer}
.gtw-err{position:fixed;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top,0px) + 60px);z-index:99999;max-width:min(560px,calc(100% - 24px));background:#3a1518;border:1px solid #8c2f36;color:#ffd9dc;border-radius:8px;padding:10px 12px;display:flex;gap:10px;align-items:flex-start;font-size:14px;box-shadow:0 10px 30px rgba(0,0,0,.5)}
.gtw-err button{background:none;border:0;color:#ffd9dc;font-size:20px;line-height:1;cursor:pointer;padding:0 2px}

/* ---------- installed on the home screen (standalone): keep clear of the notch / Dynamic Island ---------- */
html.gtweb:root{padding-top:0!important}
html.gtweb{--gt-sat:env(safe-area-inset-top,0px)}
/* (the bar's own rule is more specific, so this needs :root and [data-dark] too, or the bar's contents sit under the status bar) */
:root.gtweb header.gtbar,:root.gtweb[data-dark] header.gtbar,:root.gtweb[data-dark="1"] header.gtbar{padding-top:var(--gt-sat)!important;height:calc(48px + var(--gt-sat))!important;box-sizing:border-box!important;align-items:center!important}

/* ---------- bottom tab bar and More sheet (phones only) ---------- */
#gtw-tabs,#gtw-more{display:none}
@media (max-width:760px){
  html.gtweb body{padding-bottom:calc(62px + env(safe-area-inset-bottom,0px))!important}
  html.gtweb header.gtbar nav{display:none!important}
  html.gtweb #gtw-tabs{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:9000;height:calc(56px + env(safe-area-inset-bottom,0px));padding:0 6px env(safe-area-inset-bottom,0px);background:rgba(14,16,22,.92);-webkit-backdrop-filter:blur(18px) saturate(1.4);backdrop-filter:blur(18px) saturate(1.4);border-top:1px solid rgba(255,255,255,.08)}
  #gtw-tabs button{flex:1;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:none!important;border:0!important;box-shadow:none!important;color:#8d929b!important;font:600 10.5px/1 'Open Sans','Segoe UI',system-ui,sans-serif!important;letter-spacing:.02em!important;text-transform:none!important;padding:6px 0 4px!important;margin:0!important;min-width:0;height:auto!important;border-radius:0!important;-webkit-tap-highlight-color:transparent}
  #gtw-tabs button svg{width:24px;height:24px}
  #gtw-tabs button.on{color:var(--g-accent,#7ab8e8)!important}
  html.gtweb #gtw-more{display:block;position:fixed;inset:0;z-index:9500;pointer-events:none}
  #gtw-more .bk{position:absolute;inset:0;background:rgba(0,0,0,.5);opacity:0;transition:opacity .2s}
  #gtw-more .sh{position:absolute;left:0;right:0;bottom:0;max-height:78vh;overflow:auto;background:var(--g-solid,#171a24);border-radius:16px 16px 0 0;border-top:1px solid rgba(255,255,255,.1);padding:8px 12px calc(68px + env(safe-area-inset-bottom,0px));transform:translateY(105%);transition:transform .25s cubic-bezier(.2,.8,.2,1)}
  html.gtweb #gtw-more.open{pointer-events:auto}#gtw-more.open .bk,#gtw-more.open .sh{pointer-events:auto}#gtw-more.open .bk{opacity:1}#gtw-more.open .sh{transform:none}
  #gtw-more .grab{display:block;width:40px;height:5px;border-radius:3px;background:rgba(255,255,255,.25);margin:2px auto 10px}
  #gtw-more .ls{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  #gtw-more .ls button{display:flex!important;flex-direction:column;align-items:flex-start;gap:3px;text-align:left;padding:12px!important;min-height:64px;border-radius:12px!important;background:rgba(255,255,255,.05)!important;border:1px solid rgba(255,255,255,.08)!important;color:#fff!important;text-transform:none!important;letter-spacing:0!important;font:600 15px/1.2 'Open Sans','Segoe UI',system-ui,sans-serif!important}
  #gtw-more .ls button small{font-weight:400;font-size:11.5px;color:#9aa0a8;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  #gtw-more .ls button.on{border-color:var(--g-accent,#7ab8e8)!important;background:var(--g-accent-soft,rgba(122,184,232,.12))!important}

  /* a finger on an item scrolls the page (it used to be blocked, so the vault could not be scrolled by touching items) */
  html.gtweb #vgrid .vt{touch-action:pan-y!important}

  /* the loadout editor is a full sheet over the tab bar (its Save buttons used to sit under the bar); its pop-ups and messages go above it */
  html.gtweb #dled{top:calc(var(--gt-sat) + 6px)!important;height:auto!important;z-index:9100!important;border-radius:14px 14px 0 0}
  html.gtweb #dled .dl-ef{padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))}
  html.gtweb #dled .dl-ef button{flex:1 1 auto}
  html.gtweb #dlmod{z-index:9200!important;padding:calc(var(--gt-sat) + 8px) 8px calc(66px + env(safe-area-inset-bottom,0px));box-sizing:border-box}
  html.gtweb #dlmod .dl-mc{max-height:100%;min-width:0;width:100%}
  html.gtweb #loimg{z-index:9200!important;padding:calc(var(--gt-sat) + 12px) 10px calc(12px + env(safe-area-inset-bottom,0px))}
  html.gtweb #loimg .li{max-height:100%;overflow:auto;padding:10px}
  html.gtweb #dlt{z-index:9300!important;left:12px!important;right:12px;max-width:none!important;bottom:calc(68px + env(safe-area-inset-bottom,0px))!important}

  /* floating Notes button and toasts sit above the tab bar */
  html.gtweb #gtnfab{bottom:calc(68px + env(safe-area-inset-bottom,0px))!important}

  /* item popup becomes a bottom sheet, over the top bar and character headers */
  html.gtweb #vsheet{z-index:8500!important}
  html.gtweb #vsheet .dp{left:0!important;right:0!important;top:auto!important;bottom:calc(56px + env(safe-area-inset-bottom,0px))!important;width:auto!important;max-height:none;filter:none;box-shadow:0 -10px 30px rgba(0,0,0,.6)}
  html.gtweb #vsheet .dp .dpm{flex:1;min-width:0;width:auto!important;border-radius:14px 0 0 0!important}
  html.gtweb #vsheet .dp .dps{flex:none;border-radius:0 14px 0 0!important}

  /* Activity sub-pages: one row that scrolls sideways instead of five rows of pills */
  html.gtweb #activity .abar{flex-wrap:nowrap!important;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;margin:0 -12px;padding:8px 12px!important;scroll-snap-type:x proximity}
  html.gtweb #activity .abar::-webkit-scrollbar{display:none}
  html.gtweb #activity .abar>button{flex:none;scroll-snap-align:start}
  html.gtweb #activity .abar .sp{flex:none;margin-left:6px}
  html.gtweb #triumphs .tseg{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;max-width:100%}
  html.gtweb #triumphs .tseg::-webkit-scrollbar{display:none}
  html.gtweb #triumphs .tseg>button{flex:none;white-space:nowrap}
  /* Settings: the text on top, the control under it */
  html.gtweb .sx{flex-wrap:wrap;gap:8px 12px}
  html.gtweb .sx .sxt{flex:1 1 100%;min-width:0}
  html.gtweb .sx .sxc{flex:1 1 100%;display:flex;justify-content:flex-start}
  html.gtweb .sx .sxc:has(.tgl:only-child){flex:none;margin-left:auto}
  html.gtweb .sx:has(.sxc .tgl:only-child) .sxt{flex:1 1 0}
  html.gtweb .sx .sxc select,html.gtweb .sx .sxc input[type=range]{max-width:100%}
  /* Notes: a small round button so it covers less */
  html.gtweb #gtnfab{right:12px!important;width:44px;height:44px;padding:0!important;border-radius:50%!important;font-size:0!important;display:flex;align-items:center;justify-content:center}
  html.gtweb #gtnfab::before{content:'\270E';font-size:19px;line-height:1}
  /* iPhone: no zoom-in when tapping a text box (Safari zooms anything under 16px), no grey tap flash */
  html.gtweb input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),html.gtweb select,html.gtweb textarea{font-size:16px!important}
  html.gtweb *{-webkit-tap-highlight-color:transparent}
  /* bigger touch targets */
  html.gtweb section button.g,html.gtweb section button.b{min-height:36px}
}
