/* Media Boxes — demo bar for the example sites. A clean floating bar: graphite, white text, one accent button.
   Loaded by brand pages with <link rel="stylesheet" href="assets/demo-bar.css">. Everything is prefixed mbdb and isolated from the brand's CSS.
   Fixed position, so it adds no layout shift; the body gets bottom padding from the very first paint so the end of the page is never covered. */

body[data-demo] { padding-bottom: 68px; }

.mbdb, .mbdb *, .mbdb *::before, .mbdb *::after { box-sizing: border-box; }
.mbdb :where(a, button, span, strong, small, div, p, h2, pre, code) { all: unset; box-sizing: border-box; }
.mbdb :where(div, p, h2, pre) { display: block; }
.mbdb :where(strong, small, span, code) { display: inline; }

.mbdb {
  --mbdb-bg: #111318;
  --mbdb-text: #ffffff;
  --mbdb-muted: #b3b9c3;
  /* the same coral as demo.css (accent fill, accent hover, lighter coral for focus on dark); the bar is always graphite, so it has no theme switch */
  --mbdb-red-button: #d2363c;
  --mbdb-red-button-hover: #b82d33;
  --mbdb-red-text: #ff7a7d;
  --mbdb-red-select: rgb(255 122 125 / 0.4);
  /* syntax colours: the single definition for the bar's code panel. demo.css repeats these as --demo-code-* because the
     bar is self-contained (brand pages never load demo.css) and the site's pages must not load this file (its body[data-demo] padding). */
  --mbdb-code-text: #d9dde2;
  --mbdb-code-muted: #8b949e;
  --mbdb-code-tag: #8fb4ff;
  --mbdb-code-str: #a8d5b0;
  --mbdb-code-key: #f2f4f6;
  --mbdb-code-num: #ff9d8f;
  --mbdb-code-ground: #0a0b0e;
  position: fixed; z-index: 2147483000; left: 0; right: 0; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  padding-inline: 12px; pointer-events: none;
  font: 500 14px/1.3 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: var(--mbdb-text);
  -webkit-font-smoothing: antialiased;
}
.mbdb > * { pointer-events: auto; }

.mbdb a:focus-visible, .mbdb button:focus-visible, .mbdb [tabindex]:focus-visible { outline: 2px solid var(--mbdb-red-text); outline-offset: 2px; }
.mbdb ::selection { background: var(--mbdb-red-select); color: #fff; }

/* The bar */
.mbdb__bar {
  position: relative; display: flex; align-items: center; gap: 4px; max-width: 100%; min-height: 52px; padding: 8px;
  background: var(--mbdb-bg); border: 1px solid rgb(255 255 255 / 0.1); border-radius: 12px;
  box-shadow: 0 4px 12px rgb(17 19 24 / 0.18), 0 16px 40px rgb(17 19 24 / 0.3);
}

.mbdb__btn, .mbdb__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; min-width: 36px; padding: 0 12px;
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; color: var(--mbdb-text); cursor: pointer; border-radius: 8px;
  transition: background-color 140ms ease;
}
.mbdb__btn:hover, .mbdb__link:hover { background: rgb(255 255 255 / 0.12); }
.mbdb__btn[aria-expanded='true'] { background: rgb(255 255 255 / 0.16); }
.mbdb__btn--primary { color: #fff; background: var(--mbdb-red-button); }
.mbdb__btn--primary:hover { background: var(--mbdb-red-button-hover); }
.mbdb__btn svg, .mbdb__link svg { width: 16px; height: 16px; flex: none; }
.mbdb__btn[hidden] { display: none; }
.mbdb__icon { padding: 0; width: 36px; }

.mbdb__id { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 10px; min-width: 0; }
.mbdb__id strong { font-size: 14px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mbdb__id small { display: block; font-size: 12px; font-weight: 500; line-height: 1.1; color: var(--mbdb-muted); white-space: nowrap; }
.mbdb__sep { flex: none; width: 1px; align-self: stretch; margin: 4px 4px; background: rgb(255 255 255 / 0.18); }
.mbdb__pager { display: inline-flex; align-items: center; }
.mbdb__pos { padding-inline: 4px; font-size: 13px; font-weight: 500; line-height: 1; color: var(--mbdb-muted); font-variant-numeric: tabular-nums; }

/* Collapsed: a small tab, bottom left */
.mbdb__full { display: contents; }
.mbdb[data-collapsed='true'] { align-items: flex-start; }
.mbdb[data-collapsed='true'] .mbdb__bar { padding: 4px; min-height: 0; }
.mbdb[data-collapsed='true'] .mbdb__full { display: none; }
.mbdb:not([data-collapsed='true']) .mbdb__tab { display: none; }
.mbdb__tab { gap: 8px; padding-inline: 12px 14px; }

/* Code panel */
.mbdb__panel {
  width: min(780px, 100%); max-height: min(62vh, 560px); display: flex; flex-direction: column;
  background: var(--mbdb-bg); border: 1px solid rgb(255 255 255 / 0.1); border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 12px rgb(17 19 24 / 0.2), 0 24px 56px rgb(17 19 24 / 0.4);
}
.mbdb__panel[hidden] { display: none; }
.mbdb__phead { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid rgb(255 255 255 / 0.14); }
.mbdb__phead h2 { flex: 1 1 auto; font-size: 14px; font-weight: 700; }
.mbdb__note { padding: 12px 16px 0; font-size: 13px; line-height: 1.5; color: var(--mbdb-muted); }
.mbdb__note[hidden] { display: none; }
.mbdb__pre { flex: 1 1 auto; min-height: 0; margin: 12px; padding: 16px; overflow: auto; font: 12.5px/1.7 ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; color: var(--mbdb-code-text); background: var(--mbdb-code-ground); border-radius: 8px; white-space: pre; tab-size: 2; scrollbar-color: rgb(255 255 255 / 0.3) transparent; }
.mbdb__pre code { display: block; white-space: pre; }
.mbdb .tk-c { color: var(--mbdb-code-muted); } .mbdb .tk-t { color: var(--mbdb-code-tag); } .mbdb .tk-s { color: var(--mbdb-code-str); } .mbdb .tk-k { color: var(--mbdb-code-key); } .mbdb .tk-n { color: var(--mbdb-code-num); }

@media (max-width: 720px) {
  .mbdb__bar { flex-wrap: wrap; justify-content: space-between; row-gap: 2px; width: 100%; padding: 8px; }
  .mbdb__id { flex: 1 1 100px; }
  .mbdb__sep { display: none; }
  .mbdb__pager { order: 2; }
  .mbdb__codebtn, .mbdb__get { flex: 1 1 40%; }
  .mbdb__get { order: 4; }
  .mbdb__codebtn { order: 3; }
  .mbdb[data-collapsed='true'] .mbdb__bar { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .mbdb__btn, .mbdb__link { transition: none; }
}
