/* App shell styles (blueprint app-shell/shell; from CELA cela_app_shell.css L156). Uses the page tokens
   (--bg, --panel, --line, --text, --muted, --ok). */

/* No rubber-band bounce or pull-to-reload of the whole page; no double-tap zoom on controls. */
html, body { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button, a, [role="tab"], .tab, summary, label { touch-action: manipulation; }

/* Controls behave like app controls: no text selection or long-press callout on them.
   Data (addresses, hashes, commands) stays selectable so it can still be copied. */
button, .tabbar, .tab, .pill, .icon-btn, .sidenav, header, .brand, #boot, .app-ptr, img {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
code, pre, .mono, td, input, textarea { -webkit-user-select: text; user-select: text; }

/* Press feedback: controls give way under a finger. */
button, .tab, .icon-btn, a.card, button.card, .stat, .map-card, [data-act], [data-go] {
  transition: transform .12s ease, background-color .15s ease, opacity .15s ease; }
button:active:not(:disabled), .icon-btn:active, a.card:active, button.card:active, button.stat:active,
.map-card:active, [data-act]:active, [data-ip]:active { transform: scale(.97); }
.tabbar .tab:active { transform: scale(.92); }

/* Tab transitions. */
.app-enter { animation-duration: .22s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); animation-fill-mode: both; }
.app-enter.from-right { animation-name: appFromRight; }
.app-enter.from-left { animation-name: appFromLeft; }
.app-enter.fade { animation-name: appFade; }
@keyframes appFromRight { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes appFromLeft { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes appFade { from { opacity: 0; } to { opacity: 1; } }

/* Pull to refresh. */
.app-ptr { position: fixed; z-index: 40; left: 50%; top: calc(env(safe-area-inset-top) + 6px);
  width: 38px; height: 38px; margin-top: -44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel, #101211); border: 1px solid var(--line, rgba(255,255,255,.08)); color: var(--muted, #9aa39d);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); opacity: 0; transform: translate(-50%, 0);
  transition: opacity .15s ease, transform .2s ease, color .15s ease; pointer-events: none; }
.app-ptr.ready { color: var(--ok, #3ddc84); }
.app-ptr.spinning svg { animation: appSpin .8s linear infinite; color: var(--ok, #3ddc84); }
@keyframes appSpin { to { transform: rotate(360deg); } }

/* Offline notice, above the tab bar. */
.app-offline { position: fixed; z-index: 45; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 76px);
  transform: translate(-50%, 20px); max-width: calc(100vw - 32px); padding: 9px 14px; border-radius: 999px;
  background: var(--panel, #101211); border: 1px solid var(--line, rgba(255,255,255,.08)); color: var(--text, #f2f5f3);
  font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-offline.show { opacity: 1; transform: translate(-50%, 0); }

/* Loading skeleton while the snapshot is checked and decrypted. */
.app-skel[hidden] { display: none; }
.app-skel { display: grid; gap: 12px; margin-top: 4px; }
.app-skel-label { margin: 0 0 2px; color: var(--muted, #9aa39d); font-size: 13px; }
.app-skel-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.app-skel-block { border-radius: 16px; border: 1px solid var(--line, rgba(255,255,255,.07));
  background: linear-gradient(100deg, var(--panel, #101211) 30%, rgba(255,255,255,.06) 50%, var(--panel, #101211) 70%) 0 0 / 300% 100%;
  animation: appShimmer 1.3s ease-in-out infinite; }
.app-skel-block.tile { height: 76px; }
.app-skel-block.card { height: 112px; }
@keyframes appShimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* The iOS haptic switch: present for the tick, never seen. */
.app-haptic { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* A dot on a tab with something unseen. */
.tabbar .tab { position: relative; }
.tabbar .tab[data-unseen]::after { content: ""; position: absolute; top: 6px; left: calc(50% + 8px);
  width: 8px; height: 8px; border-radius: 50%; background: var(--warn, #ffc94d); box-shadow: 0 0 0 2px var(--bg, #070807); }

@media (prefers-reduced-motion: reduce) {
  .app-enter, .app-skel-block, .app-ptr.spinning svg { animation: none !important; }
  button:active, .tab:active, .icon-btn:active { transform: none !important; }
}
