/* board-base.css v1 (2026-11-02): the phone rules every board shares. Deep dive R1-R4, R9.
 * Source: /Users/ericair/.claude/var/boards/DEEP-DIVE-2026-11-02.md (real iPhone walk, Safari).
 * Load it FIRST so a board's own CSS can still style; the rules below win only where they must
 * (marked !important) because each one fixes a thing a phone user could not do.
 * Needs <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
 * or env(safe-area-inset-*) reads 0. Copy into a board with:  bb-vendor <dest-dir>  (keeps one source).
 *
 * Hooks a board adds to its own markup:
 *   .bb-topbar   the top bar: sticky, opaque, clears the clock/notch            (R2)
 *   .bb-inner    any inner scroll box: becomes plain flow under 500 px          (R1)
 *   .bb-float    a floating pill/button: sits above Safari's bar, own gutter    (R3)
 *   .bb-commit   a button that writes (bid, verify, send): kept out of the bottom 90 pt (R3, checked by bb-check)
 *   .bb-sheet    a sheet/drawer: opens at its top (call bbOpenSheet(el) from board-base.js) (R9)
 */

:root {
  --bb-bar-bg: #0d1014;          /* opaque top bar; a board overrides with its own background */
  --bb-safe-top: env(safe-area-inset-top, 0px);
  --bb-safe-bottom: env(safe-area-inset-bottom, 0px);
  --bb-bottom-keepout: 90px;     /* Safari's bottom bar + thumb zone: no commit control lives here */
  --bb-tap: 44px;                /* Apple HIG minimum hit target */
}

/* R2: content never runs under the clock. */
body { padding-top: var(--bb-safe-top); }
.bb-topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bb-bar-bg);
  padding-top: var(--bb-safe-top);
  margin-top: calc(-1 * var(--bb-safe-top));   /* the bar itself fills the notch band, opaque */
}

/* R3: the page can always scroll its last row above Safari's bar; floating pills reserve their gutter. */
body { padding-bottom: calc(var(--bb-bottom-keepout) + var(--bb-safe-bottom)); }
.bb-float {
  position: fixed; z-index: 45;
  bottom: calc(var(--bb-safe-bottom) + 16px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
}
.bb-float-gutter { padding-right: 72px; }   /* put on a column the pill would cover */

/* R4: 44 pt tap targets on every control. Inline prose links are exempt (min-height has no effect inline). */
button, summary, select, [role="button"], input[type="submit"], input[type="button"],
a.bb-btn, nav a, .bb-tap {
  min-height: var(--bb-tap);
  min-width: var(--bb-tap);
}
input[type="checkbox"], input[type="radio"] { min-width: 24px; min-height: 24px; }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: var(--bb-tap); display: inline-flex; align-items: center; gap: 8px; }
input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="tel"],
input[type="password"], input[type="url"], textarea, select { font-size: 16px; min-height: var(--bb-tap); }

/* R1: under 500 px the page scrolls; no inner scroll box hides content. */
@media (max-width: 499px) {
  html, body { height: auto !important; min-height: 100%; overflow-y: auto !important; }
  .bb-inner {
    overflow: visible !important; max-height: none !important; height: auto !important;
    flex: none !important;
  }
  /* wide tables swipe sideways instead of losing their right-hand columns (P3) */
  .bb-wide { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; max-width: 100%; }
  table.bb-wide { white-space: nowrap; }
}

/* R9: a sheet scrolls on its own and never drags the page under it. */
.bb-sheet { overscroll-behavior: contain; }
