html.is-app {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
html.is-app body {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  padding-bottom: env(safe-area-inset-bottom);
}
/* Keep text selectable where people need it. Change .story-content to your story text class */
html.is-app input, html.is-app textarea,
html.is-app [contenteditable="true"], html.is-app .story-content {
  -webkit-user-select: text; user-select: text;
}
html.is-app a, html.is-app button { touch-action: manipulation; }
html.is-app button, html.is-app .btn {
  transition: transform .08s ease, opacity .08s ease;
}
html.is-app button:active, html.is-app .btn:active { transform: scale(.97); opacity: .9; }
html.is-app img { -webkit-user-drag: none; }
html.is-app ::-webkit-scrollbar { display: none; }

/* ---- Bottom tab bar (app only) ---- */
html.is-app { --tabbar-h: 68px; }

/* main.css gives the body a fixed height:100%. On long pages the content spills
   out of that box, so bottom padding was lost and the bar covered the last
   button (Logout). Letting the body grow with its content fixes it. */
html.is-app.has-tabbar body {
  height: auto;
  min-height: 100vh;
  box-sizing: border-box;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}
html.is-app .app-hide { display: none !important; }

#app-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
  display: flex; align-items: stretch; box-sizing: border-box;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
#app-tabbar a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; font-size: 13px;
  color: #6b7280; text-decoration: none;
}
#app-tabbar .ti { font-size: 27px; line-height: 1; }
#app-tabbar a.active { color: #667eea; font-weight: 700; }

/* ---- Compact app header ---- */
html.is-app header.tt-header { padding: 8px 0; }
html.is-app header.tt-header .tt-nav { display: none; }
html.is-app header.tt-header .tt-top { flex-wrap: wrap; }
html.is-app header.tt-header .tt-search { display: none; flex: 1 1 100%; margin-top: 8px; }
html.is-app header.tt-header .tt-top.search-open .tt-search { display: flex; }
html.is-app .app-search-toggle {
  flex: none; width: 40px; height: 40px; padding: 0; margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.2); color: #fff;
}

/* ---- Tighter hero on small screens, no web install banner in the app ---- */
html.is-app .hero { padding: 40px 20px; margin-bottom: 24px; border-radius: 0 0 32px 32px; }
html.is-app .hero h1 { font-size: 2.1rem; }
html.is-app .install-card { display: none !important; }

/* ---- No footer in the app: its links live in Settings ---- */
html.is-app footer, html.is-app .js-footer { display: none !important; }

/*Block out ads from app */
html.is-app ins.adsbygoogle { display: none !important; }