/* Lab demo banner, shared by every page under /lab/<slug>.
   A slim bar at the top of each prototype: what it is, a way back to /lab, and an "I'd use this" email link.
   It sits in the normal flow (sticky), so the app below starts under it. Its height is written to --lab-bar-h
   by the small script after the bar, so apps with fixed or full-height layouts can subtract it.
   z-index 45: above app headers, below app modals and drawers (z-50), so a modal's close button is never covered. */
:root { --lab-bar-h: 44px; }

/* The rest of the site opts in to cross-document page transitions; opting in here too keeps the move
   between /lab and a demo smooth (and avoids an aborted-transition error on the way in). */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

.lab-bar {
  position: sticky;
  top: 0;
  z-index: 45;
  box-sizing: border-box;
  /* Three columns: back link on the left, the note centred on the page, the button on the far right */
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 6px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
  background: #111;
  color: #f5f5f5;
  border-bottom: 1px solid #262626;
  font: 500 12px/1.35 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.lab-bar *, .lab-bar *::before, .lab-bar *::after { box-sizing: border-box; }

.lab-bar .lab-bar-back,
.lab-bar .lab-bar-cta {
  flex: none;
  max-width: none;
  text-decoration: none;
  white-space: nowrap;
}
.lab-bar .lab-bar-back {
  padding: 6px 0;
  justify-self: start;
  color: #d4d4d4;
  font: 700 11px/1 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.lab-bar .lab-bar-back:hover { color: #fff; }

.lab-bar .lab-bar-note {
  grid-column: 2;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  color: #e5e5e5;
  font: inherit;
  line-height: 1.35;
  text-align: center;
}
.lab-bar .lab-bar-note span { white-space: nowrap; }

.lab-bar .lab-bar-cta {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #111;
  font: 700 12px/1 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: background-color .15s ease;
}
.lab-bar .lab-bar-cta:hover { background: #fde047; color: #111; }
.lab-bar a:focus-visible { outline: 2px solid #fde047; outline-offset: 2px; }

@media (max-width: 640px) {
  .lab-bar { gap: 10px; font-size: 11px; }
  .lab-bar .lab-bar-cta { padding: 7px 10px; font-size: 11.5px; }
}

/* Clean screenshots: add class "lab-capture" to <html> to hide the bar. */
html.lab-capture .lab-bar { display: none; }
