/* Bearamedics app pieces: install sheet, offline bar, toasts. Everything is prefixed bmx- so it cannot clash with page styles.
   Colors are set here once; build.mjs can swap them to match the live site's own values. */
:root {
  --bmx-navy: #1b2f5c;
  --bmx-red: #b3282d;
  --bmx-gold: #c98a12;
  --bmx-cream: #f4f6f9;
  --bmx-ink: #14213d;
  --bmx-head: 'Alfa Slab One', Georgia, serif;
  --bmx-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bmx-mono: 'Courier Prime', 'Courier New', monospace;
}

/* Offline bar, shown at the top while there is no signal */
.bmx-offline-bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 2147483000;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 16px 6px;
  background: var(--bmx-navy); color: var(--bmx-cream);
  font: 600 13px/1.35 var(--bmx-body); text-align: center;
  border-bottom: 3px solid var(--bmx-gold);
  transform: translateY(-110%); transition: transform .25s ease;
}
.bmx-offline-bar.bmx-show { transform: none; }
.bmx-offline-bar a { color: var(--bmx-gold); }

/* Install banner (bottom) */
.bmx-banner {
  position: fixed; left: 12px; right: 12px; z-index: 2147483001;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  max-width: 520px; margin: 0 auto;
  display: flex; gap: 12px; align-items: center;
  padding: 12px 12px 12px 14px;
  background: var(--bmx-cream); color: var(--bmx-ink);
  border: 2px solid var(--bmx-navy); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  font: 15px/1.35 var(--bmx-body);
}
.bmx-banner img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.bmx-banner p { margin: 0; flex: 1; min-width: 0; }
.bmx-banner strong { display: block; font: 16px/1.2 var(--bmx-head); color: var(--bmx-navy); letter-spacing: .01em; }
.bmx-banner .bmx-x {
  flex: none; width: 32px; height: 32px; border: 0; background: none; color: var(--bmx-navy);
  font-size: 22px; line-height: 1; cursor: pointer; border-radius: 6px;
}

.bmx-btn {
  appearance: none; border: 2px solid var(--bmx-navy); border-radius: 8px; cursor: pointer;
  padding: 9px 14px; min-height: 44px;
  background: var(--bmx-navy); color: var(--bmx-cream);
  font: 700 14px/1.1 var(--bmx-body); letter-spacing: .02em; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.bmx-btn:hover { background: #24375f; }
.bmx-btn.bmx-ghost { background: transparent; color: var(--bmx-navy); }
.bmx-btn.bmx-red { background: var(--bmx-red); border-color: var(--bmx-red); }
.bmx-btn[hidden] { display: none !important; }
.bmx-btn:disabled { opacity: .55; cursor: default; }
.bmx-btn:focus-visible, .bmx-x:focus-visible { outline: 3px solid var(--bmx-gold); outline-offset: 2px; }

/* Install sheet */
.bmx-sheet-back {
  position: fixed; inset: 0; z-index: 2147483002; background: rgba(15, 22, 38, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.bmx-sheet {
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  background: var(--bmx-cream); color: var(--bmx-ink);
  border-radius: 16px 16px 0 0; border-top: 6px solid var(--bmx-red);
  padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  font: 16px/1.5 var(--bmx-body);
}
@media (min-width: 640px) {
  .bmx-sheet-back { align-items: center; }
  .bmx-sheet { border-radius: 16px; }
}
.bmx-sheet h2 { margin: 0 0 6px; font: 26px/1.15 var(--bmx-head); color: var(--bmx-navy); }
.bmx-sheet .bmx-kicker { margin: 0 0 4px; font: 700 12px/1 var(--bmx-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--bmx-red); }
.bmx-sheet ol { margin: 14px 0; padding-left: 0; list-style: none; counter-reset: s; }
.bmx-sheet ol li { counter-increment: s; position: relative; padding: 8px 0 8px 40px; border-top: 1px dashed rgba(27,42,74,.25); }
.bmx-sheet ol li:first-child { border-top: 0; }
.bmx-sheet ol li::before {
  content: counter(s); position: absolute; left: 0; top: 7px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--bmx-navy); color: var(--bmx-gold); font: 15px/28px var(--bmx-head); text-align: center;
}
.bmx-sheet .bmx-share { display: inline-block; vertical-align: -4px; width: 18px; height: 18px; }
.bmx-sheet .bmx-note { font-size: 14px; color: #4a4a44; margin: 10px 0 0; }
.bmx-sheet .bmx-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Toast */
.bmx-toast {
  position: fixed; left: 50%; z-index: 2147483003; transform: translate(-50%, 20px); opacity: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  width: max-content; max-width: calc(100vw - 32px);
  background: var(--bmx-navy); color: var(--bmx-cream); border-radius: 10px; padding: 12px 16px;
  font: 600 14px/1.4 var(--bmx-body); box-shadow: 0 8px 24px rgba(0,0,0,.3);
  transition: opacity .2s, transform .2s;
}
.bmx-toast.bmx-show { opacity: 1; transform: translate(-50%, 0); }
.bmx-toast a { color: var(--bmx-gold); }

/* Footer link added to every page */
.bmx-footer-app { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .bmx-offline-bar, .bmx-toast { transition: none; }
}
@media print {
  .bmx-offline-bar, .bmx-banner, .bmx-sheet-back, .bmx-toast { display: none !important; }
}
