/* Forge app shell (2.0). Only active with body.v2shell (ForgeShell.mount). */
body.v2shell #topbar, body.v2shell #bottombar { display: none !important; }
body.v2shell {
  --sh-top: calc(52px + env(safe-area-inset-top));
  --sh-bar: calc(62px + env(safe-area-inset-bottom));
  padding-bottom: var(--sh-bar);
}

#sh-top {
  position: sticky; top: 0; z-index: 100;
  height: var(--sh-top); padding: env(safe-area-inset-top) 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(10, 10, 10, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid #1a1a1a;
}
#sh-top button, #sh-bar button, #sh-sheet button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#sh-top .sh-brand { font-family: 'Orbitron', monospace; font-weight: 900; font-size: 16px; letter-spacing: 0.22em; color: #fff; padding: 6px 0; }
#sh-top .sh-right { display: flex; align-items: center; gap: 8px; }
#sh-top .sh-streak { font-family: 'Inter', -apple-system, sans-serif; font-size: 13px; color: #ddd; background: #161616; border: 1px solid #222; border-radius: 999px; padding: 5px 10px; }
#sh-top .sh-streak b { font-weight: 700; }
#sh-top .sh-timer { font-family: 'Inter', -apple-system, sans-serif; font-size: 13px; color: #fff; background: rgba(124,108,255,0.2); border: 1px solid #5a4fd0; border-radius: 999px; padding: 5px 10px; }
#sh-top .sh-timer b { font-weight: 700; font-variant-numeric: tabular-nums; }
#sh-top .sh-icon { position: relative; width: 36px; height: 36px; display: grid; place-items: center; color: #bbb; border-radius: 10px; }
#sh-top .sh-icon svg { width: 20px; height: 20px; }
#sh-top .sh-badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ff3b3b; color: #fff; font: 700 9px/16px 'Inter', sans-serif; text-align: center; }
#sh-top .sh-badge[hidden] { display: none; }
#sh-top .sh-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #7c6cff, #4b3fd1); color: #fff; font: 700 14px 'Inter', sans-serif; display: grid; place-items: center; overflow: hidden; }
#sh-top .sh-avatar img { width: 100%; height: 100%; object-fit: cover; }

#sh-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  height: var(--sh-bar); padding: 6px 8px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(10, 10, 10, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid #1a1a1a;
}
#sh-bar .sh-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #5f5f5f; border-radius: 12px; transition: color 0.15s; }
#sh-bar .sh-tab span { font: 600 10px 'Inter', -apple-system, sans-serif; letter-spacing: 0.02em; }
#sh-bar .sh-tab.active { color: #fff; }
#sh-bar .sh-tab.active svg { color: #9b8fff; }
#sh-bar .sh-tab:active { transform: scale(0.94); }
@media (min-width: 769px) {
  #sh-bar { left: 50%; right: auto; width: 520px; transform: translateX(-50%); bottom: 14px; height: 62px; padding: 6px; border: 1px solid #222; border-radius: 20px; }
  body.v2shell { padding-bottom: 96px; }
}

#sh-sheet { position: fixed; inset: 0; z-index: 899; background: rgba(0, 0, 0, 0); pointer-events: none; transition: background 0.2s; }
#sh-sheet.open { background: rgba(0, 0, 0, 0.55); pointer-events: auto; }
#sh-sheet .sh-sheet-card {
  position: absolute; left: 0; right: 0; bottom: var(--sh-bar); margin: 0 auto; max-width: 560px;
  background: #111; border: 1px solid #222; border-bottom: none; border-radius: 18px 18px 0 0; padding: 8px 12px 12px;
  transform: translateY(calc(100% + 120px)); visibility: hidden;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.25s;
}
#sh-sheet.open .sh-sheet-card { transform: none; visibility: visible; transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
@media (min-width: 769px) { #sh-sheet .sh-sheet-card { bottom: 88px; border-radius: 18px; border-bottom: 1px solid #222; } }
#sh-sheet .sh-grab { width: 36px; height: 4px; border-radius: 2px; background: #333; margin: 2px auto 8px; }
#sh-sheet .sh-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 12px; text-align: left; }
#sh-sheet .sh-row + .sh-row { border-top: 1px solid #1a1a1a; }
#sh-sheet .sh-row.active { background: #1a1a1a; }
#sh-sheet .sh-row-ic { width: 36px; height: 36px; border-radius: 10px; background: #1a1a1a; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
#sh-sheet .sh-row-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#sh-sheet .sh-row-t b { font: 600 15px 'Inter', -apple-system, sans-serif; color: #fff; }
#sh-sheet .sh-row-t small { font: 12px 'Inter', -apple-system, sans-serif; color: #666; margin-top: 1px; }
#sh-sheet .sh-chev { color: #444; font-size: 20px; }

/* the mentor page fills the screen between the two bars */
body.v2shell #page-mentor.active { height: calc(100vh - var(--sh-top) - var(--sh-bar)); height: calc(100dvh - var(--sh-top) - var(--sh-bar)); }
/* toasts and the share pop-up sit above the tab bar */
body.v2shell #xp-toast { bottom: calc(var(--sh-bar) + 12px) !important; }
/* the notifications panel drops from the new bar */
body.v2shell #notif-panel { top: calc(var(--sh-top) + 6px) !important; right: 12px !important; max-width: calc(100vw - 24px); }
