/* Studio navigation and identity. Colours follow the existing appearance preference. */
.rtbs-header, .rtbs-context, .rtbs-footer {
  color: var(--appearance-text);
  background: var(--appearance-canvas);
  font: 400 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.rtbs-header { border-bottom: 1px solid var(--appearance-rule); }
.rtbs-inner {
  width: min(100%, 1440px);
  box-sizing: border-box;
  margin-inline: auto;
  padding-inline: clamp(16px, 5vw, 64px);
}
.rtbs-header > .rtbs-inner {
  display: grid;
  grid-template: "brand nav appearance" auto / auto 1fr auto;
  align-items: center;
  gap: clamp(14px, 3vw, 44px);
  min-height: 76px;
  padding-block: 10px;
}
.rtbs-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  width: fit-content;
  color: inherit;
  font-weight: 640;
  letter-spacing: -.045em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.rtbs-header .rtbs-brand { grid-area: brand; font-size: 18px; }
.rtbs-brand img.rtbs-mark {
  display: block;
  flex: none;
  width: 12px;
  height: 36px;
  max-width: none;
  box-sizing: content-box;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  image-rendering: pixelated;
}
.rtbs-header .rtbs-nav { grid-area: nav; justify-content: end; }
.rtbs-header .rtbs-appearance { grid-area: appearance; justify-self: end; }
.rtbs-nav, .rtbs-context-nav, .rtbs-footer-nav, .rtbs-social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(14px, 2.3vw, 32px);
  margin: 0;
  padding: 0;
}
.rtbs-nav a, .rtbs-context-nav a, .rtbs-footer-nav a, .rtbs-footer-bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--appearance-text);
  font: 500 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  text-decoration: none;
  letter-spacing: normal;
}
.rtbs-nav a[aria-current], .rtbs-context-nav a[aria-current], .rtbs-footer-nav a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--rtb-focus);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
:is(.rtbs-header, .rtbs-context, .rtbs-footer) a:hover {
  color: var(--appearance-text);
  text-decoration: underline;
  text-underline-offset: 5px;
}
:is(.rtbs-header, .rtbs-context, .rtbs-footer) a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
/* The head initializer selects the theme before the control is enhanced.
   Reserve its row and column from first paint, including on narrow phones. */
html[data-appearance] .rtbs-header .rtbs-appearance {
  display: grid;
  justify-items: end;
  align-content: center;
  min-width: 188px;
  min-height: 52px;
}
.rtbs-context-nav { gap: 0 24px; }
.rtbs-context-nav a { color: var(--appearance-muted); font-size: 12px; }
.rtbs-footer {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(32px, 5vw, 64px) 0 16px;
  border: 0;
  border-top: 1px solid var(--appearance-rule);
}
.rtbs-footer > .rtbs-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 20px;
}
.rtbs-footer-top, .rtbs-footer-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  grid-column: 1 / -1;
}
.rtbs-footer .rtbs-brand { font-size: clamp(26px, 3.4vw, 48px); }
.rtbs-footer .rtbs-brand img.rtbs-mark { width: 16px; height: 48px; }
.rtbs-footer-context {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--appearance-muted);
  font-size: 13px;
}
.rtbs-social { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.rtbs-social-label, .rtbs-footer-bottom {
  margin: 0;
  color: var(--appearance-muted);
  font: 500 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .05em;
}
.rtbs-social-links { gap: 0 4px; }
.rtbs-social-links a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--appearance-text);
}
.rtbs-social-links svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.rtbs-social-links a:hover { background: var(--appearance-hover); }
.rtbs-footer .rtbs-appearance { grid-column: 2; justify-self: end; margin: 0; }
.rtbs-footer-bottom { border-top: 1px solid var(--appearance-rule); padding-top: 10px; }
.rtbs-footer-bottom a { font-size: 12px; }
@media (max-width: 680px) {
  .rtbs-header > .rtbs-inner {
    grid-template: "brand appearance" auto "nav nav" auto / minmax(0, 1fr) auto;
    gap: 0 6px;
    padding-block: 6px 0;
  }
  .rtbs-header .rtbs-brand { font-size: 15px; gap: 8px; }
  html[data-appearance] .rtbs-header .rtbs-appearance { min-width: 154px; }
  .rtbs-header .rtbs-appearance label span { min-width: 44px; padding-inline: 4px; }
  .rtbs-header .rtbs-nav { justify-content: space-between; gap: 0 12px; }
  .rtbs-footer > .rtbs-inner { grid-template-columns: 1fr; gap: 16px; }
  .rtbs-footer-top { align-items: flex-start; flex-direction: column; gap: 14px; }
  .rtbs-footer .rtbs-appearance { grid-column: 1; justify-self: start; }
  .rtbs-footer-bottom { gap: 2px 14px; }
}
@media (forced-colors: active) {
  :is(.rtbs-header, .rtbs-context, .rtbs-footer) a:focus-visible { outline-color: Highlight; }
}
@media print {
  .rtbs-header, .rtbs-context, .rtbs-footer { display: none; }
}

/* The four hosted showcases also share these existing content metrics and skip link. */
html[data-rtb-page="hosted"] {
  --rtb-gutter: clamp(20px, 4vw, 64px);
  --rtb-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  scroll-behavior: auto;
}
html[data-rtb-page="hosted"], html[data-rtb-page="hosted"] body { background-color: var(--rtb-canvas); }
.rtbs-skip, html[data-rtb-page="hosted"] .skip-link {
  position: fixed;
  inset: 12px auto auto 16px;
  z-index: 100;
  min-height: 44px;
  margin: 0;
  padding: 12px 18px;
  color: var(--appearance-canvas);
  background: var(--appearance-text);
  transform: translateY(-180%);
}
.rtbs-skip:focus, html[data-rtb-page="hosted"] .skip-link:focus { transform: none; }
.rtbs-footer-context a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-underline-offset: 4px; }
.rtbs-footer .rtbs-wordmark, .rtbs-footer .rtbs-footer-bottom span { color: inherit; width: auto; order: 0; }
