/* Compact sticky head with local disclosure menus and an error-only strip. */
.preview-page-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.preview-page-head .topbar {
  padding: var(--space-3) 28px;
  gap: var(--space-4);
  border-bottom: 0;
  flex-wrap: wrap;
}
.preview-page-head .topbar .eyebrow,
.preview-page-head .demo-label,
.preview-legacy-create {
  display: none !important;
}
.preview-page-head .preview-headline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  flex: 1 1 200px;
  min-width: 0;
}
.preview-page-head h1 {
  font-size: 24px;
  line-height: 1.35;
  min-height: 0;
  margin: 0;
}
#previewSaveStatus {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
#previewSaveStatus.danger-text {
  color: var(--danger);
}
.preview-page-head .topright {
  display: flex;
  width: auto;
  gap: var(--space-2);
  flex: 0 0 auto;
  justify-content: flex-end;
}
.preview-page-head .connection-bar {
  padding: var(--space-2) 28px;
  gap: var(--space-2);
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-size: 12px;
}
.preview-page-head .connection-bar button {
  min-height: 40px;
  padding: var(--space-2);
}
.preview-page-head #connectionStatus {
  flex-basis: 100%;
}
.preview-original-page-action {
  display: none !important;
}
.preview-menu {
  position: relative;
  flex-shrink: 0;
}
.preview-theme {
  display: block;
  min-width: 0;
  margin: 0;
}
.preview-menu > .icon-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#previewMore {
  font-size: 24px;
  line-height: 1;
}
#previewTheme svg,
#previewMobileTheme svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.preview-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 50;
  min-width: 180px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 140px);
  overflow: auto;
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.preview-menu-panel button {
  display: block;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  box-shadow: none;
}
.preview-menu-panel button:hover,
.preview-menu-panel button:focus-visible {
  background: var(--surface-hover);
}
#previewMoreChoices button {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.preview-menu-panel button[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: var(--accent-ink);
  font-weight: 650;
}
.preview-theme.floating {
  padding: 0;
  border: 0;
  top: 16px;
  right: 16px;
  background: transparent;
}
.order-initial-filter {
  top: calc(var(--preview-head-height, 0px) + var(--space-3));
  max-height: calc(100dvh - var(--preview-head-height, 0px) - var(--space-6));
}
#content :is(button, input, select, textarea, summary),
.board-scroll {
  scroll-margin-top: calc(var(--preview-head-height, 0px) + var(--space-3));
}
.hall-mode .preview-page-head {
  display: none;
}
.hall-mode.hall-controls .preview-page-head {
  display: block;
}
@media (max-width: 1100px) {
  .preview-page-head .topbar,
  .preview-page-head .connection-bar {
    padding-inline: 18px;
  }
}
@media (max-width: 760px) {
  .preview-page-head .topbar {
    position: static;
    flex-direction: row;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    gap: var(--space-2);
  }
  .preview-page-head .topbar > div:first-child {
    max-width: none;
    min-height: 0;
    flex-basis: 100%;
  }
  .preview-page-head .topbar .preview-theme {
    position: relative;
    top: auto;
    right: auto;
  }
  .preview-page-head .topright {
    margin-left: auto;
  }
  .preview-page-head h1 {
    font-size: 22px;
  }
  .preview-page-head .connection-bar {
    padding: var(--space-2) var(--space-4);
  }
}
