*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  /* App feel (CLAUDE.md "Runtime: Android app WebView"): no page bounce/glow, no text selection or long-press
     callout outside text fields. Scrollers inside the page keep `overscroll-behavior: contain`. */
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, [contenteditable], .selectable {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

body {
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* App frame, breakpoints, safe areas and font scale: see layout.css. */

/* Top bar */
#top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top-bar-inner {
  display: flex;
  align-items: center;
  height: 48px;
  gap: 12px;
}
.app-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--amber-ink);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tab content */
#tab-content {
  flex: 1;
  min-width: 0;
}
.tab-view { display: none; }
.tab-view.active { display: block; }

/* Bottom tab bar */
.tab-bar {
  position: sticky;
  bottom: 0;
  z-index: 100;
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 0;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: color 0.15s;
}
.tab-btn.active { color: var(--amber-ink); }
.tab-icon { width: 22px; height: 22px; }
.tab-label { font-size: 12px; font-weight: 600; }

/* Coin overlay */
.coin-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.coin-overlay.hidden {
  transform: translateY(100%);
  pointer-events: none;
}


/* Utility */
.mono { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; }
.text-up { color: var(--up); }
.text-down { color: var(--down); }
.text-muted { color: var(--muted); }
.text-amber { color: var(--amber-ink); }

/* The hidden attribute always wins over component display rules (e.g. inline-flex buttons). */
[hidden] { display: none !important; }

/* Visually hidden but read by screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Scrollbar — thin on desktop */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
