/* assets/css/bbm-components.css — shared components (DESIGN.md Stage 1). Loaded on every page by
   index.php, after tokens.css. Built on the tokens; looks like the app already did, just tidier. */

/* ── Page scrolling: no elastic bounce in the installed app (html.bbm-standalone, set in index.php) or
   inside the mini-player's frame (html.bbm-in-frame, bbm-shell.js). On iPhone the bounce at the top
   dragged the page and its header down and left an empty gap until the finger was let go. Browser
   tabs keep it: there it is the pull-to-refresh gesture. ── */
html.bbm-standalone, html.bbm-standalone body,
html.bbm-in-frame, html.bbm-in-frame body { overscroll-behavior-y: none; }
@media (display-mode: standalone) { html, body { overscroll-behavior-y: none; } }

/* ── bbm_header() (classes/ui.php) ─────────────────────────────────────────────
   [menu/back] [logo + title] … [one coloured action] [… menu]; 44 px buttons; safe areas. */
.bbm-header { padding-top: calc(var(--bbm-space-3) + env(safe-area-inset-top, 0px)) !important; }
.bbm-header--plain { background: var(--bbm-bg); }
.bbm-header .bbm-header__row { display: flex; align-items: center; gap: var(--bbm-space-2); min-height: 52px; padding-bottom: var(--bbm-space-2); }
.bbm-header__lead, .bbm-header__trail { display: flex; align-items: center; gap: var(--bbm-space-2); flex: 0 0 auto; min-width: var(--bbm-tap); }
.bbm-header__trail { justify-content: flex-end; }
.bbm-header__title { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: var(--bbm-space-2); }
.bbm-header__title .logo { width: 30px; height: 30px; flex-shrink: 0; }
.bbm-header__text { min-width: 0; }
.bbm-header__text h1 { margin: 0; font-size: var(--bbm-text-md); font-weight: 700; line-height: 1.2; color: var(--bbm-text);
                       white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bbm-header__text p { margin: 2px 0 0; font-size: var(--bbm-text-xs); color: var(--bbm-text-muted); }
.bbm-header--brand .bbm-header__text h1, .bbm-header--brand .bbm-header__text p { color: #fff; }
.bbm-header--brand #header-pin-panel { color: #fff; }   /* Home's chat pin toolbar, shown in the same header */
/* the theme's boxed icon buttons, at least 44 × 44 to tap */
.bbm-header .bbm-header__btn { display: inline-flex; align-items: center; justify-content: center;
                               min-width: var(--bbm-tap); min-height: var(--bbm-tap); padding: 0; margin: 0; }
.bbm-header .bbm-header__btn .icon-btn { width: var(--bbm-tap) !important; height: var(--bbm-tap) !important; }
.bbm-header .bbm-header__btn.dropdown-toggle::after { display: none; }
/* the one coloured action */
.bbm-header__action { display: inline-flex; align-items: center; gap: 6px; min-height: var(--bbm-tap); padding: 0 14px;
                      border-radius: var(--bbm-radius-pill); background: var(--bbm-brand); color: var(--bbm-on-brand) !important;
                      font-weight: 600; font-size: var(--bbm-text-sm); text-decoration: none; white-space: nowrap; }
.bbm-header--brand .bbm-header__action { background: #fff; color: var(--bbm-brand-strong) !important; }
.bbm-header__action:active { transform: scale(.97); }

/* Text selection and the cursor in the brand colour (batch 12 B5: the iPhone's default blue highlight and handles) */
::selection { background: rgba(1, 170, 133, .3); }
html { caret-color: #01AA85; accent-color: #01AA85; }

/* Offline banner (batch 12 E, assets/js/bbm-offline.js — only for people inside OFFLINE_FOR): a small dark pill under the
   top of the screen while the phone has no network; "Back online" in the brand colour for a moment when it returns */
#bbm-offline-banner { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + var(--bbm-space-2)); transform: translateX(-50%); z-index: 2147483000;
    max-width: calc(100vw - 2 * var(--bbm-space-4)); padding: var(--bbm-space-2) var(--bbm-space-4); border-radius: var(--bbm-radius-pill, 999px);
    background: #1f2b28; color: #fff; font: 600 var(--bbm-text-sm, 13px)/1.3 var(--bbm-font, system-ui); text-align: center; box-shadow: var(--bbm-shadow-2);
    pointer-events: none; }
#bbm-offline-banner.is-back { background: var(--bbm-brand-strong, #018a6c); }
#bbm-offline-banner[hidden] { display: none; }

/* Batch 14 Part 4: no visible scrollbars on the phone pages (a bar showed at the right edge on the iPhone and in the installed
   app); scrolling itself is unchanged (touch, wheel, keyboard). The production portal on a computer (body.desk) keeps its
   scrollbars — a mouse needs them. */
html:not(:has(> body.desk)), body:not(.desk), body:not(.desk) * { scrollbar-width: none; -ms-overflow-style: none; }
html:not(:has(> body.desk))::-webkit-scrollbar, body:not(.desk)::-webkit-scrollbar, body:not(.desk) *::-webkit-scrollbar { display: none; width: 0; height: 0; }
