/* Builder landing is a page section, so the overview and catalog remain reachable. */
html[data-workspace-chooser="open"],
html[data-workspace-chooser="open"] body { overflow: visible; }
.workspace-start.studio-launcher {
  position: relative;
  z-index: auto;
  inset: auto;
  overflow: visible;
  min-height: calc(100dvh - var(--header-height, 72px));
  box-sizing: border-box;
  scroll-margin-top: var(--header-height, 72px);
}
/* Apply from the head bootstrap, including direct links and refreshed uploads. */
html[data-studio-entry="upload"] :is(.workspace-titlebar, .workspace-catalog, .preview-footer),
html[data-studio-source-entry]:not([data-studio-active-view="overview"]) :is(.workspace-titlebar, .workspace-catalog, .preview-footer) { display: none !important; }

.builder-loading { display: none; }
html[data-builder-loading] .workspace-page > :not([data-builder-loading]),
html[data-builder-loading] .preview-footer { display: none !important; }
html[data-builder-loading] .builder-loading {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - var(--header-height, 72px));
  box-sizing: border-box;
  padding: clamp(24px, 5vw, 64px) 20px;
  background: #f4f1ed;
}
.builder-loading-card { width: min(100%, 850px); box-sizing: border-box; padding: clamp(28px, 5vw, 64px); border-radius: 28px; border: 1px solid #e5dfea; background: #fffdfb; color: #201c27; box-shadow: 0 18px 60px #30213e12; }
.builder-loading-card h1 { margin: 12px 0; font-size: clamp(28px, 4vw, 46px); line-height: 1.15; letter-spacing: -.04em; }
.builder-loading-card p { color: #71687d; }
.builder-loading-card .preview-eyebrow { color: #7559cf; margin-top: 22px; }
.builder-loading-spinner { display: block; width: 32px; height: 32px; border: 3px solid #e8e1f3; border-top-color: #7559cf; border-radius: 50%; animation: builder-opening 1s linear infinite; }
.builder-loading-shapes { display: grid; gap: 14px; margin-top: 36px; }
.builder-loading-shapes i { display: block; height: 48px; border-radius: 12px; background: #f2eef7; animation: builder-wait 1.8s ease-in-out infinite alternate; }
.builder-loading-shapes i:last-child { width: 65%; }
.builder-loading-actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.builder-loading-actions[hidden] { display: none; }
.builder-loading-actions button { padding: 12px 18px; border: 0; border-radius: 12px; color: white; background: #7559cf; font: inherit; cursor: pointer; }
.builder-loading-actions a { color: #624aab; }
.builder-loading-actions :focus-visible { outline: 3px solid #7559cf; outline-offset: 4px; }
@keyframes builder-opening { to { transform: rotate(360deg); } }
@keyframes builder-wait { to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .builder-loading-spinner, .builder-loading-shapes i { animation: none; } }

/* Keep the return link beside the view tabs, leaving the upload guide flush
   against the site header when the introductory title is hidden. */
.workspace-page > .workspace-view-tabs { padding: 8px 0; }
.workspace-page .workspace-view-tabs-inner { display: flex; align-items: center; gap: 16px; }
.workspace-view-tabs-inner > .studio-workspace-return {
  flex: 0 0 auto; margin: 0; min-height: 44px; box-sizing: border-box;
}
.workspace-view-tabs-inner > .workspace-view-tabs-track { flex: 0 1 510px; min-width: 0; }
html[data-upload-template="active"] .workspace-view-tabs-inner { width: min(calc(100% - 42px), 1840px); }
@media (max-width: 680px) {
  .workspace-page .workspace-view-tabs-inner,
  html[data-upload-template="active"] .workspace-view-tabs-inner { width: calc(100% - 28px); gap: 8px; }
  .workspace-view-tabs-inner > .studio-workspace-return { gap: 5px; padding: 8px; font-size: 12px; }
  .workspace-view-tabs-inner > .studio-workspace-return svg { width: 16px; height: 16px; }
  .workspace-page .workspace-view-tabs button { padding: 10px 5px; }
  .workspace-page .workspace-view-tabs button > strong { font-size: 12px; white-space: nowrap; }
}
@media (max-width: 360px) {
  .workspace-page .workspace-view-tabs button { padding: 6px 4px; }
  .workspace-page .workspace-view-tabs button > strong { white-space: normal; }
}

/* Upload receipts hide the view tabs, but retain the way back to Studio. */
html[data-upload-template="active"][data-upload-completion]:not([data-upload-completion=""]) .workspace-page > .workspace-view-tabs { display: block !important; }
html[data-upload-template="active"][data-upload-completion]:not([data-upload-completion=""]) .workspace-view-tabs-track { display: none; }
