@import url("./brand-mark.css");

/* Input-origin admission is shared by all recipes and native UA outlines.
   Pointer focus remains functional; only keyboard focus receives a ring. */
:root[data-bb-focus-origin="pointer"] :focus-visible { outline: none; }

/*
 * Canonical application-surface, Select, Menu, and shared control interaction recipes.
 * Products retain behavior, state, positioning, invocation, and product semantics.
 */

:root {
  --bb-resizable-toolbar-handle-thickness: 9px;
  --bb-resizable-toolbar-grip-length: 96px;
  --bb-resizable-toolbar-grip-thickness: 3px;
  --bb-layout-interaction-layer: 40;
}

.bb-attention-pulse {
  animation: bb-attention-pulse 1000ms ease-in-out;
}

@keyframes bb-attention-pulse {
  0%, 100% { box-shadow: 0 0 12px 2px transparent; }
  50% {
    box-shadow: 0 0 12px 2px color-mix(in srgb, var(--bb-interface-control-focus-ring) 65%, transparent);
  }
}

.bb-workspace-surface {
  color: var(--bb-interface-control-foreground);
  background: var(--bb-interface-workspace-background);
}

/* Opening is a workspace state, with the same chrome surface and typography.
 * Products supply the existing brand mark and one status title. */
.bb-workspace-opening {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  overflow: auto;
  box-sizing: border-box;
  padding: var(--bb-spacing-5);
  color: var(--bb-v2-color-content-primary);
  background: var(--bb-interface-workspace-background);
  font-family: var(--bb-font-family-body);
}

.bb-workspace-opening__content {
  display: grid;
  justify-items: center;
  gap: var(--bb-spacing-4);
  max-inline-size: 100%;
  text-align: center;
}

.bb-workspace-opening__title {
  margin: 0;
  font-family: var(--bb-font-family-display);
  font-size: var(--bb-font-size-xl);
  font-weight: var(--bb-font-weight-bold);
  line-height: var(--bb-font-line-height-tight);
  visibility: hidden;
}

.bb-workspace-opening[data-bb-opening-ready] .bb-workspace-opening__title {
  visibility: visible;
}

.bb-workspace-surface[tabindex="-1"]:focus {
  outline: none;
}

/* One visible viewport bounds a full application and its content below chrome.
   Consumers supply the current header height, including their collapsed state. */
.bb-workspace-frame {
  --bb-workspace-frame-height: 100dvh;
  height: var(--bb-workspace-frame-height);
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--bb-v2-color-content-primary);
  background: var(--bb-v2-color-surface-canvas);
  font-family: var(--bb-font-family-body);
  -webkit-user-select: none;
  user-select: none;
}

.bb-workspace-frame :is(input, textarea, [contenteditable="true"], [contenteditable="plaintext-only"]) {
  -webkit-user-select: text;
  user-select: text;
}

.bb-workspace-frame__content {
  height: calc(var(--bb-workspace-frame-height) - var(--bb-workspace-frame-header-height, 0px));
  min-width: 0;
  min-height: 0;
}

/* Adjacent authored viewports share one zoom-scaled separation. */
.bb-layout-viewport-gallery {
  --bb-layout-viewport-gap: 24px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: calc(var(--bb-layout-viewport-gap) * var(--bb-layout-viewport-scale, 1));
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  padding: 0;
}

.bb-layout-world-stage { position: absolute; inset: 0 auto auto 0; z-index: var(--bb-layout-interaction-layer); overflow: hidden; transform-origin: top left; pointer-events: none; contain: layout paint; }
.bb-layout-world-stage--no-paint-containment { contain: layout; }
.bb-layout-world-layer { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.bb-layout-viewport-interaction-surface { position: absolute; pointer-events: none; }
/* Keep category layers out of stacking contexts so authored input hit order
   remains shared. Only artwork pixels move to the GPU; hosts stay interactive. */
.bb-layout-world-stage--composed :is(.bb-layout-media__surface, .layout-master-text__surface, .layout-master-shape__surface, .layout-master-dynamic__surface) { opacity: 0; }
.bb-layout-world-stage--composed .bb-layout-editor-text-caret-host::after { visibility: hidden; }
.bb-layout-viewport-surface { position: absolute; inset: 0 auto auto 0; isolation: isolate; overflow: hidden; background-color: var(--asset-bg-color, var(--bb-v2-color-surface-canvas)); background-image: var(--asset-bg-base); background-size: var(--asset-bg-base-size); background-position: var(--asset-bg-base-position); background-repeat: no-repeat; opacity: var(--asset-bg-opacity, 1); transform-origin: top left; pointer-events: auto; }
.bb-layout-viewport-surface::before, .bb-layout-viewport-surface::after { position: absolute; inset: 0; display: block; content: ""; pointer-events: none; }
.bb-layout-viewport-surface::before { z-index: 0; background: var(--asset-bg-overlay); }
.bb-layout-viewport-surface::after { z-index: 1; background-image: var(--asset-bg-image); background-size: var(--asset-bg-image-size); background-position: var(--asset-bg-image-position); background-repeat: var(--asset-bg-image-repeat); opacity: var(--asset-bg-image-opacity); }
.bb-layout-viewport-surface.bb-layout-viewport-surface--composed { opacity: 0; }

.bb-layout-render-surface { position: absolute; inset: 0 auto auto 0; display: block; margin: 0; filter: drop-shadow(0 34px 90px rgba(0,0,0,.38)); }
.bb-layout-render-output { width: 100%; height: 100%; }
.bb-layout-render-surface.bb-layout-render-surface--no-shadow { filter: none; }
.bb-layout-render-element { position: absolute; display: block; box-sizing: border-box; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; outline: 0; overflow: visible; -webkit-user-select: none; user-select: none; }
.bb-layout-render-projection { position: absolute; display: block; }
.bb-layout-render-media { position: absolute; inset: 0; display: block; visibility: hidden !important; opacity: 0 !important; }
.bb-layout-render-media > :is(img, video) { display: block; width: 100%; height: 100%; object-fit: contain; }

/* A bounded media frame composes the shared render-surface geometry. Its
   backdrop and legacy document layers retain the same surface shadow. */
.bb-media-frame, .bb-media-frame__layer { box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55); }
.bb-media-frame { position: relative; width: 100%; height: 100%; background: #0b0f10; }
.bb-media-frame__canvas { background: transparent; pointer-events: none; }
.bb-media-frame__layer { position: absolute; top: 0; left: 0; background: transparent; pointer-events: none; opacity: 0; will-change: transform, opacity; }
.bb-media-frame__layer { width: var(--bb-media-frame-layer-width, 1080px); height: var(--bb-media-frame-layer-height, 1920px); border: 0; overflow: hidden; transform-origin: top left; user-select: none; }
.bb-media-frame__layer.is-active { opacity: 1; }

/* Shared scrolling content, independent of sidebar or full-workspace placement. */
.bb-workspace-scroll-surface {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--bb-v2-color-surface-canvas);
  -webkit-user-select: none;
  user-select: none;
}

.bb-workspace-scroll-surface .panel {
  border-color: rgba(113, 210, 215, 0.16);
  background: transparent;
}

.bb-workspace-scroll-surface :is(input[type="text"], input[type="number"], textarea, [contenteditable="true"]) {
  -webkit-user-select: text;
  user-select: text;
}

.bb-workspace-scroll-surface label > :is(select, .bb-select) {
  width: 100%;
}

.bb-workspace-section {
  display: grid;
  align-content: start;
  gap: 0;
  min-width: 0;
  padding: var(--bb-spacing-4);
  border: 0;
  border-bottom: 1px solid var(--bb-v2-color-border-subtle);
  border-radius: 0;
  color: var(--bb-v2-color-content-primary);
  background: transparent;
  font-family: var(--bb-font-family-body);
}

.bb-workspace-section--compact {
  padding: var(--bb-spacing-2) var(--bb-spacing-3);
}

.bb-workspace-section > summary {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: var(--bb-spacing-3);
  min-width: 0;
  min-height: 24px;
  color: var(--bb-v2-color-content-primary);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-bold);
  list-style: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.bb-workspace-section > summary::-webkit-details-marker {
  display: none;
}

.bb-workspace-section__icon {
  align-self: center;
  justify-self: center;
  width: 10px;
  height: 10px;
  transition: transform var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing);
}

.bb-workspace-section[open] > summary .bb-workspace-section__icon {
  transform: rotate(90deg);
}

.bb-workspace-section[open] > summary .bb-workspace-section__count {
  display: none;
}

.bb-workspace-section__label {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 24px;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bb-workspace-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 3px var(--bb-spacing-2);
  border: 1px solid color-mix(in srgb, var(--bb-v2-identity-primary) 28%, transparent);
  border-radius: 999px;
  color: var(--bb-v2-identity-primary);
  background: color-mix(in srgb, var(--bb-v2-identity-primary) 10%, transparent);
  font-size: var(--bb-font-size-xs);
  font-style: normal;
  font-weight: var(--bb-font-weight-bold);
  text-transform: uppercase;
}

.bb-workspace-section > *:not(summary) {
  margin-top: var(--bb-spacing-5);
}

.bb-workspace-section--compact > *:not(summary) {
  margin-top: var(--bb-spacing-2);
}

.bb-resizable-toolbar {
  --bb-resizable-toolbar-brand-inline-start: 0px;
  --bb-resizable-toolbar-handle-size: 0px;
}

.bb-resizable-toolbar__handle {
  --bb-resizable-toolbar-grip-gradient-axis: 90deg;
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  background: var(--bb-interface-workspace-background);
  cursor: default;
}

.bb-resizable-toolbar__handle[aria-orientation="horizontal"] {
  block-size: var(--bb-resizable-toolbar-handle-thickness);
  border-block: 1px solid var(--bb-v2-color-border-subtle);
}

.bb-resizable-toolbar__handle[aria-orientation="vertical"] {
  --bb-resizable-toolbar-grip-gradient-axis: 180deg;
  inline-size: var(--bb-resizable-toolbar-handle-thickness);
  border-inline: 1px solid var(--bb-v2-color-border-subtle);
}

.bb-resizable-toolbar__grip {
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--bb-v2-identity-primary) 20%, transparent);
  border-radius: var(--bb-radius-full);
  background: linear-gradient(
    var(--bb-resizable-toolbar-grip-gradient-axis),
    color-mix(in srgb, var(--bb-v2-identity-primary) 4%, transparent),
    color-mix(in srgb, var(--bb-v2-identity-primary) 30%, transparent),
    color-mix(in srgb, var(--bb-v2-identity-primary) 4%, transparent)
  );
  box-shadow:
    inset 0 0 4px color-mix(in srgb, var(--bb-v2-color-content-primary) 5%, transparent),
    0 0 6px color-mix(in srgb, var(--bb-v2-identity-primary) 7%, transparent);
}

.bb-resizable-toolbar__handle[aria-orientation="horizontal"] .bb-resizable-toolbar__grip {
  inline-size: var(--bb-resizable-toolbar-grip-length);
  block-size: var(--bb-resizable-toolbar-grip-thickness);
  cursor: row-resize;
}

.bb-resizable-toolbar__handle[aria-orientation="vertical"] .bb-resizable-toolbar__grip {
  inline-size: var(--bb-resizable-toolbar-grip-thickness);
  block-size: var(--bb-resizable-toolbar-grip-length);
  cursor: col-resize;
}

.bb-resizable-toolbar__grip:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *), :active),
.bb-resizable-toolbar__grip.is-active {
  border-color: color-mix(in srgb, var(--bb-v2-identity-primary) 78%, transparent);
  background: linear-gradient(
    var(--bb-resizable-toolbar-grip-gradient-axis),
    color-mix(in srgb, var(--bb-v2-identity-primary) 28%, transparent),
    var(--bb-v2-identity-primary),
    color-mix(in srgb, var(--bb-v2-identity-primary) 28%, transparent)
  );
  box-shadow:
    inset 0 0 6px color-mix(in srgb, var(--bb-v2-color-content-primary) 22%, transparent),
    0 0 10px color-mix(in srgb, var(--bb-v2-identity-primary) 32%, transparent);
}

.bb-workspace-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--bb-spacing-3);
  min-width: 188px;
}

.bb-workspace-brand__mark,
.bb-workspace-brand__wordmark {
  display: block;
  width: 36px;
  height: 36px;
  color: var(--bb-v2-identity-primary);
  object-fit: contain;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--bb-v2-identity-primary) 38%, transparent));
}

.bb-workspace-brand__wordmark {
  width: 188px;
  height: 36px;
}

.bb-workspace-brand__mark--narrow {
  display: none;
}

.bb-workspace-topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  white-space: nowrap;
  flex: 1 1 auto;
  padding: 7px 18px;
}

.bb-workspace-topbar__actions > * {
  flex: 0 0 auto;
}

.bb-workspace-topbar__actions::before {
  content: "";
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.bb-workspace-topbar__actions select,
.bb-workspace-topbar__actions .bb-select {
  max-width: min(320px, 34vw);
}

/* Within a navigation viewport, tabs are content, never another scroll box.
   Standalone tab strips retain their own scroll contract. */
.bb-workspace-topbar__actions > .bb-workspace-tabs {
  width: max-content;
  flex: 0 0 auto;
  overflow: visible;
}

@media (max-width: 760px) {
  .bb-workspace-topbar.bb-resizable-toolbar {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 8px;
    padding-inline: 8px;
  }

  .bb-workspace-topbar .bb-workspace-brand--adaptive {
    min-width: 0;
  }

  .bb-workspace-topbar .bb-workspace-brand--adaptive .bb-workspace-brand__wordmark {
    display: none;
  }

  .bb-workspace-topbar .bb-workspace-brand--adaptive .bb-workspace-brand__mark--narrow {
    display: block;
  }

  .bb-workspace-topbar .bb-workspace-topbar__actions {
    width: 100%;
    min-width: 0;
    padding-inline: 0;
    scrollbar-gutter: auto;
  }

}

.bb-workspace-brand__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bb-workspace-brand__eyebrow,
.bb-workspace-brand__title {
  margin: 0;
  font-family: var(--bb-font-family-display);
  line-height: 1.15;
  white-space: nowrap;
}

.bb-workspace-brand__eyebrow {
  color: var(--bb-v2-identity-primary);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bb-workspace-brand__title {
  color: var(--bb-v2-color-content-primary);
  font-size: var(--bb-font-size-md);
  font-weight: var(--bb-font-weight-semibold);
  letter-spacing: 0;
}

.bb-resizable-toolbar__collapsed-brand {
  position: absolute;
  inset-block: 0 var(--bb-resizable-toolbar-handle-size);
  inset-inline-start: var(--bb-resizable-toolbar-brand-inline-start);
  display: none;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--bb-interface-control-foreground);
  font-family: var(--bb-font-family-display);
  font-size: 13px;
  font-weight: var(--bb-font-weight-semibold);
  letter-spacing: 0.06em;
  line-height: 1;
  text-shadow: none;
  white-space: nowrap;
}

.bb-resizable-toolbar__collapsed-brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--bb-v2-identity-primary);
  object-fit: contain;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--bb-v2-identity-primary) 45%, transparent));
}

.bb-interface-action,
.bb-interface-controls button:not(.theme-swatch):not([data-bb-theme-control]):not(.bb-workspace-stage-surface),
.bb-interface-controls .bb-select__trigger {
  transition:
    border-color var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    box-shadow var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    color var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    filter var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    text-shadow var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing);
}

.bb-interface-controls button:not(.theme-swatch):not([data-bb-theme-control]):not(.bb-workspace-stage-surface),
.bb-interface-controls .bb-select__trigger {
  border-color: transparent;
  color: var(--bb-interface-control-foreground);
  background-color: transparent;
  box-shadow: none;
  font-family: var(--bb-font-family-body);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-bold);
  line-height: 1.2;
}

.bb-interface-action:disabled,
.bb-interface-controls button:not(.theme-swatch):not([data-bb-theme-control]):not(.bb-workspace-stage-surface):disabled {
  color: var(--bb-interface-control-disabled-foreground);
  cursor: default;
  opacity: 0.42;
}

.bb-workspace-chrome {
  color: var(--bb-interface-control-foreground);
  background: var(--bb-v2-color-surface-canvas);
  font-family: var(--bb-font-family-body);
}

.bb-workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bb-spacing-4);
  min-width: 0;
  min-height: 56px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--bb-v2-color-border-subtle);
  box-shadow: var(--bb-shadow-md);
}

.bb-workspace-topbar.bb-resizable-toolbar {
  border-bottom: 0;
}

.bb-workspace-topbar__identity {
  flex: 0 0 auto;
  color: var(--bb-v2-color-content-primary);
  font-family: var(--bb-font-family-display);
  font-size: var(--bb-font-size-sm);
  font-weight: var(--bb-font-weight-semibold);
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.bb-workspace-tabs {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 3px;
  overflow-x: auto;
  overflow-y: hidden;
}

.bb-workspace-tabs__tablist {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.bb-workspace-tabs__action-slot {
  display: contents;
}

.bb-workspace-tab,
.bb-workspace-control-button {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: var(--bb-radius-md);
  color: var(--bb-interface-control-foreground);
  background: transparent;
  box-shadow: none;
  filter: none;
  font-family: var(--bb-font-family-body);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-bold);
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    box-shadow var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    color var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    filter var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    text-shadow var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing);
}

.bb-workspace-tab {
  min-height: 38px;
  padding: 0 16px;
  font-size: var(--bb-font-size-sm);
}

.bb-workspace-control-button {
  min-width: 42px;
  min-height: 30px;
  padding: 0 10px;
}

.bb-workspace-control-button--compact {
  min-width: 0;
  padding: 0 6px;
}

.bb-interface-action:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *), [data-specimen-state="hover"], [data-specimen-state="focusVisible"]):not(:disabled):where(:not([aria-pressed="true"]):not([aria-selected="true"]):not([aria-expanded="true"])),
.bb-interface-controls button:where(:not(.theme-swatch):not([data-bb-theme-control]):not(.bb-workspace-stage-surface)):is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *)):not(:disabled):where(:not(.active):not([aria-pressed="true"]):not([aria-selected="true"]):not([aria-expanded="true"])),
.bb-workspace-tab:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *)):where(:not(:disabled):not([aria-selected="true"])),
.bb-workspace-control-button:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *)):where(:not(:disabled):not([aria-pressed="true"]):not(.active)),
.bb-workspace-tab[data-specimen-state="hover"],
.bb-workspace-control-button[data-specimen-state="hover"] {
  outline: none;
  border-color: transparent;
  color: var(--bb-interface-button-hover-foreground);
  background: var(--bb-interface-button-hover-background);
  box-shadow: var(--bb-interface-button-hover-shadow);
  text-shadow: var(--bb-interface-button-hover-text-shadow);
  filter: var(--bb-interface-button-hover-filter);
}

.bb-interface-action:is(:active, [aria-pressed="true"], [data-specimen-state="pressed"]):not(:disabled),
.bb-interface-controls button:not(.theme-swatch):not([data-bb-theme-control]):not(.bb-workspace-stage-surface):is(:active, .active, [aria-pressed="true"]):not(:disabled),
.bb-select:is(.is-open, [data-specimen-state="open"]) .bb-select__trigger:not(:disabled),
.bb-workspace-tab:is([aria-selected="true"], [data-specimen-state="selected"]):not(:disabled),
.bb-workspace-control-button:is([aria-pressed="true"], .active, [data-specimen-state="pressed"]):not(:disabled) {
  border-color: transparent;
  color: var(--bb-interface-button-pressed-foreground);
  background: var(--bb-interface-button-pressed-background);
  box-shadow: var(--bb-interface-button-pressed-shadow);
  text-shadow: var(--bb-interface-button-pressed-text-shadow);
  filter: var(--bb-interface-button-pressed-filter);
}

.bb-workspace-tab:disabled,
.bb-workspace-tab:disabled:hover,
.bb-workspace-control-button:disabled,
.bb-workspace-control-button:disabled:hover {
  border-color: transparent;
  color: var(--bb-interface-control-disabled-foreground);
  filter: none;
  cursor: default;
  opacity: 0.42;
}

.bb-workspace-control-button--icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  padding: 0;
}

.bb-workspace-control-button--icon-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bb-spacing-2);
}

.bb-workspace-control-button--icon-label > :is(.bb-workspace-control-icon, .bb-workspace-control-label) {
  display: inline-grid;
  height: 18px;
  align-self: center;
  place-items: center;
  line-height: 1;
}

.bb-workspace-control-button--icon-label > .bb-workspace-control-label {
  transform: translateY(1px);
}

.bb-workspace-control-button--plain-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: var(--bb-interface-button-plain-icon-rest-filter);
  transition:
    color var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    filter var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing);
}

.bb-workspace-control-button.bb-workspace-control-button--plain-icon:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *)):where(:not(:disabled):not([aria-pressed="true"]):not(.active)),
.bb-workspace-control-button.bb-workspace-control-button--hover-feedback:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *)):not(:disabled),
.bb-workspace-control-button.bb-workspace-control-button--plain-icon[data-specimen-state="hover"] {
  border-color: transparent;
  color: var(--bb-interface-button-plain-icon-hover-foreground);
  background: transparent;
  box-shadow: none;
  filter: var(--bb-interface-button-plain-icon-hover-filter);
  text-shadow: none;
}

.bb-workspace-control-button.bb-workspace-control-button--plain-icon:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *):not(:disabled) {
  outline: none;
}

.bb-workspace-control-button--plain-icon .bb-workspace-control-icon {
  width: 13px;
  height: 13px;
  font-size: 13px;
}

:root {
  --bb-card-action-size: 32px;
  --bb-card-action-icon-size: 18px;
  --bb-card-action-inset: 8px;
}

.bb-card-action {
  --bb-interface-button-pressed-background: transparent;
  --bb-interface-button-pressed-shadow: none;
  --bb-interface-button-pressed-text-shadow: none;
  width: var(--bb-card-action-size);
  min-width: var(--bb-card-action-size);
  height: var(--bb-card-action-size);
  min-height: var(--bb-card-action-size);
  box-sizing: border-box;
  line-height: 0;
}

.bb-card-action.bb-workspace-control-button--plain-icon .bb-workspace-control-icon {
  width: var(--bb-card-action-icon-size);
  height: var(--bb-card-action-icon-size);
  font-size: var(--bb-card-action-icon-size);
}

.bb-card-action--favorite {
  --bb-interface-button-plain-icon-rest-filter: none;
  --bb-interface-button-plain-icon-hover-filter: var(--bb-v2-button-current-color-hover-filter);
  --bb-interface-button-pressed-filter: none;
  --bb-interface-control-foreground: var(--bb-v2-color-content-secondary);
  --bb-interface-button-plain-icon-hover-foreground: var(--bb-v2-color-status-warning-border);
  --bb-interface-button-pressed-foreground: var(--bb-v2-color-status-warning-border);
}

.bb-card-action--favorite.is-favorite {
  --bb-interface-control-foreground: var(--bb-v2-color-status-warning-border);
}

.bb-card-action__icon {
  display: grid;
  place-items: center;
}

.bb-card-action__icon--active,
.bb-card-action:is(.is-playing, .is-favorite) .bb-card-action__icon--default {
  display: none;
}

.bb-card-action:is(.is-playing, .is-favorite) .bb-card-action__icon--active {
  display: grid;
}

.bb-workspace-control-button--danger {
  --bb-interface-control-foreground: var(--bb-v2-color-status-danger-border);
  --bb-interface-button-hover-foreground: var(--bb-v2-color-status-danger-border);
  --bb-interface-button-pressed-foreground: var(--bb-v2-color-status-danger-border);
  --bb-interface-button-plain-icon-hover-foreground: var(--bb-v2-color-status-danger-border);
  --bb-interface-button-hover-filter: var(--bb-v2-button-current-color-hover-filter);
  --bb-interface-button-plain-icon-hover-filter: var(--bb-v2-button-current-color-hover-filter);
}

.bb-workspace-control-button--danger:not(:disabled),
.bb-workspace-control-button.bb-workspace-control-button--danger:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *)):not(:disabled):not([aria-pressed="true"]),
.bb-workspace-control-button.bb-workspace-control-button--danger[data-specimen-state="hover"] {
  color: var(--bb-v2-color-status-danger-border);
}

.bb-workspace-tab.bb-workspace-tab:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *):not(:disabled),
.bb-workspace-control-button.bb-workspace-control-button:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *):not(:disabled) {
  outline: 2px solid var(--bb-v2-color-border-focus-ring);
  outline-offset: 3px;
}

.bb-workspace-control-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.bb-workspace-control-icon .ms {
  --ms-size: 18px;
  --ms-fill: 0;
  --ms-weight: 300;
}

/* Shared pending controls retain disabled visuals; only the admitted icon moves. */
[aria-busy="true"]:disabled .bb-semantic-icon {
  /* Themes' existing mask confines the light to the original icon glyph. */
  background-image: linear-gradient(105deg, currentColor 40%,
    var(--bb-v2-color-content-primary) 50%, currentColor 60%);
  background-size: 250% 100%;
  background-position: 100% 0;
  animation: bb-pending-control-light 1.4s linear infinite;
}

@keyframes bb-pending-control-light {
  to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  [aria-busy="true"]:disabled .bb-semantic-icon {
    animation: none;
    background-position: 50% 0;
  }
}

/* Shared dimensions also serve embedded workspace toolbars. */
:root {
  --control-bar-height: 46px;
  --control-bar-control-height: 30px;
}

.bb-workspace-control-bar {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: var(--control-bar-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--bb-v2-color-border-subtle);
  color: var(--bb-v2-color-content-secondary);
  background: var(--bb-v2-color-surface-canvas);
  font-family: var(--bb-font-family-body);
}

input.bb-workspace-control-input.bb-workspace-control-input[type="number"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0 var(--bb-spacing-3);
  border: 1px solid transparent;
  border-radius: var(--bb-radius-md);
  outline: none;
  color: var(--bb-interface-control-foreground);
  background: transparent;
  box-shadow: none;
  font-family: var(--bb-font-family-body);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-bold);
  line-height: 1.2;
  transition:
    border-color var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    box-shadow var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    color var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing),
    text-shadow var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing);
}

input.bb-workspace-control-input.bb-workspace-control-input[type="number"]:focus {
  border-color: var(--bb-v2-identity-primary);
}

.bb-workspace-control-bar__status {
  flex: 0 0 auto;
  overflow: hidden;
  font-size: var(--bb-font-size-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bb-workspace-control-bar__leading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 0;
}

.bb-workspace-control-bar__separator {
  align-self: stretch;
  flex: 0 0 1px;
  width: 1px;
  min-height: 22px;
  margin: 4px 5px;
  background: var(--bb-v2-color-border-subtle);
}

.bb-workspace-control-bar__actions {
  display: flex;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
  margin-inline-start: auto;
  padding: 4px 0;
  white-space: nowrap;
}

/* One intrinsic-width row makes both ends reachable. Overflow clearance is
   below the centered control row and never depends on hover or focus. */
.bb-workspace-control-bar:has(> .bb-workspace-control-bar__viewport) {
  display: block;
  padding: 0;
  overflow: visible;
}
.bb-workspace-control-bar__viewport {
  box-sizing: border-box;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.bb-workspace-control-bar__row {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  min-width: 100%;
  min-height: calc(var(--control-bar-height) - 1px);
  padding-inline: 12px;
}
.bb-workspace-control-bar__row > * { flex-shrink: 0; }
.bb-workspace-control-bar__viewport.is-scrollable {
  padding-bottom: var(--bb-scrollbar-clearance);
}
.bb-workspace-control-bar__actions { position: relative; }
.bb-workspace-control-bar__overflow-separator {
  display: none;
  position: absolute;
  inset-block: 4px;
  left: -6px;
  margin: 0;
}
.bb-workspace-control-bar__viewport.is-scrollable .bb-workspace-control-bar__overflow-separator {
  display: block;
}

.bb-theme-detail-toolbar .bb-workspace-control-bar__row {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
}

.bb-theme-detail-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
}

.bb-theme-detail-toolbar > .bb-workspace-control-bar__leading,
.bb-theme-detail-toolbar .bb-workspace-control-bar__row > .bb-workspace-control-bar__leading {
  grid-column: 1;
  justify-self: start;
  max-width: 100%;
}

.bb-theme-detail-toolbar > .bb-workspace-control-bar__status,
.bb-theme-detail-toolbar .bb-workspace-control-bar__row > .bb-workspace-control-bar__status {
  grid-column: 2;
  justify-self: center;
  max-width: min(42vw, 480px);
  color: var(--bb-v2-color-content-primary);
  font-family: var(--bb-theme-detail-title-font-family);
  font-size: var(--bb-font-size-3xl);
  font-style: var(--bb-theme-detail-title-font-style, normal);
  font-weight: var(--bb-theme-detail-title-font-weight, var(--bb-font-weight-bold));
  text-align: center;
  text-decoration: var(--bb-theme-detail-title-text-decoration, none);
}

.bb-theme-detail-toolbar__title {
  position: relative;
  overflow: visible;
  line-height: 1.2;
}

.bb-theme-detail-toolbar__title > [data-control-bar-status-label] {
  display: block;
  overflow: hidden;
  text-decoration: var(--bb-theme-detail-title-text-decoration, none);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bb-theme-detail-toolbar__title > [data-control-bar-action="renameTheme"] {
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
}

.bb-theme-detail-toolbar > .bb-workspace-control-bar__actions,
.bb-theme-detail-toolbar .bb-workspace-control-bar__row > .bb-workspace-control-bar__actions {
  grid-column: 3;
  justify-self: stretch;
}

.bb-workspace-stage-surface {
  background:
    linear-gradient(45deg, var(--bb-interface-workspace-stage-checker-strong) 25%, transparent 25%),
    linear-gradient(-45deg, var(--bb-interface-workspace-stage-checker-strong) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--bb-interface-workspace-stage-checker-strong) 75%),
    linear-gradient(-45deg, transparent 75%, var(--bb-interface-workspace-stage-checker-strong) 75%);
  background-color: var(--bb-interface-workspace-stage-checker-soft);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.bb-workspace-preview-frame {
  position: relative;
  flex: 0 0 auto;
  overflow: visible;
  border: 1px solid var(--bb-v2-color-border-subtle);
  border-radius: 2px;
  background: transparent;
  box-shadow: var(--bb-shadow-lg);
}

.bb-workspace-preview-frame[data-selected="true"]::after {
  /* Consume overlay-metrics' inherited screen-space unit. The frame is unscaled;
     authored offset/glow below deliberately follow the viewport zoom instead. */
  --bb-workspace-preview-selection-stroke: calc(2px * var(--bb-layout-editor-overlay-zoom-compensation, 1));
  --bb-workspace-preview-selection-outset: min(
    calc(7px * var(--bb-layout-viewport-scale, 1)),
    calc(var(--bb-layout-viewport-gap, 24px) * var(--bb-layout-viewport-scale, 1) / 3)
  );
  content: "";
  position: absolute;
  /* The 2 px stroke paints inward from this zoom-scaled outer edge. */
  inset: calc(-1 * var(--bb-workspace-preview-selection-outset));
  /* Peer feedback must paint above composed artwork, including inward edges. */
  z-index: var(--bb-layout-interaction-layer);
  border-radius: 3px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bb-interface-workspace-selection-signal) 28%, transparent), var(--bb-interface-workspace-selection-signal), color-mix(in srgb, var(--bb-interface-workspace-selection-signal) 28%, transparent)) top / 100% var(--bb-workspace-preview-selection-stroke) no-repeat,
    linear-gradient(90deg, color-mix(in srgb, var(--bb-interface-workspace-selection-signal) 28%, transparent), var(--bb-interface-workspace-selection-signal), color-mix(in srgb, var(--bb-interface-workspace-selection-signal) 28%, transparent)) bottom / 100% var(--bb-workspace-preview-selection-stroke) no-repeat,
    linear-gradient(180deg, color-mix(in srgb, var(--bb-interface-workspace-selection-signal) 28%, transparent), var(--bb-interface-workspace-selection-signal), color-mix(in srgb, var(--bb-interface-workspace-selection-signal) 28%, transparent)) 0 var(--bb-workspace-preview-selection-stroke) / var(--bb-workspace-preview-selection-stroke) calc(100% - 2 * var(--bb-workspace-preview-selection-stroke)) no-repeat,
    linear-gradient(180deg, color-mix(in srgb, var(--bb-interface-workspace-selection-signal) 28%, transparent), var(--bb-interface-workspace-selection-signal), color-mix(in srgb, var(--bb-interface-workspace-selection-signal) 28%, transparent)) 100% var(--bb-workspace-preview-selection-stroke) / var(--bb-workspace-preview-selection-stroke) calc(100% - 2 * var(--bb-workspace-preview-selection-stroke)) no-repeat;
  filter: drop-shadow(0 0 calc(5px * var(--bb-layout-viewport-scale, 1)) color-mix(in srgb, var(--bb-interface-workspace-selection-signal) 28%, transparent));
  pointer-events: none;
}

.bb-workspace-add-tile {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px dashed var(--bb-v2-color-border-subtle);
  border-radius: var(--bb-radius-lg);
  color: var(--bb-v2-identity-primary);
  background: color-mix(in srgb, var(--bb-v2-color-surface-surface) 72%, transparent);
  cursor: pointer;
}

.bb-workspace-add-tile:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *)) {
  outline: none;
  border-color: var(--bb-v2-identity-primary);
  background: color-mix(in srgb, var(--bb-v2-identity-primary) 10%, var(--bb-v2-color-surface-surface));
}

.bb-workspace-add-tile .bb-workspace-control-icon {
  width: 42px;
  height: 42px;
  font-size: 42px;
}

.bb-workspace-add-tile .bb-workspace-control-icon .ms {
  --ms-size: 42px;
  --ms-weight: 300;
}

.bb-cut-corner-swatch {
  --bb-cut-corner-swatch-size: 4px;
  border-radius: 0;
  clip-path: polygon(
    var(--bb-cut-corner-swatch-size) 0,
    100% 0,
    100% calc(100% - var(--bb-cut-corner-swatch-size)),
    calc(100% - var(--bb-cut-corner-swatch-size)) 100%,
    0 100%,
    0 var(--bb-cut-corner-swatch-size)
  );
}

.bb-color-swatch-add {
  position: relative;
  box-sizing: border-box;
  width: 30px;
  min-width: 30px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
}

.bb-color-swatch-add:is(:hover, :focus-within) {
  outline: none;
  border-color: var(--bb-v2-identity-primary);
  background: color-mix(in srgb, var(--bb-v2-identity-primary) 10%, var(--bb-v2-color-surface-surface));
}

.bb-color-swatch-add[data-bb-color-swatch-preview] {
  background: var(--bb-color-swatch-add-preview);
}

.bb-color-swatch-add[data-bb-color-swatch-preview] .bb-workspace-control-icon {
  opacity: 0;
}

.bb-color-swatch-add__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.bb-color-swatch-add .bb-workspace-control-icon,
.bb-color-swatch-add .bb-semantic-icon {
  width: 14px;
  height: 14px;
  font-size: 14px;
}

.bb-color-swatch-add .bb-workspace-control-icon .ms {
  --ms-size: 14px;
}

.bb-color-swatch-original {
  display: inline-grid;
  place-items: center;
  color: var(--bb-interface-control-foreground);
  background: transparent;
}

.bb-color-swatch-original .bb-semantic-icon {
  width: 12px;
  height: 12px;
}

.bb-color-palette {
  display: grid;
  gap: var(--bb-spacing-2);
  min-width: 0;
}

.bb-color-palette__row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: var(--bb-spacing-2);
  min-width: 0;
}

.bb-color-palette__label {
  color: var(--bb-interface-menu-muted-foreground);
  font-family: var(--bb-font-family-body);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-semibold);
  line-height: var(--bb-font-line-height-normal);
}

.bb-color-palette__swatches {
  display: grid;
  grid-template-columns: repeat(4, 30px);
  align-items: center;
  gap: var(--bb-spacing-2);
  min-width: 0;
}

.bb-select {
  position: relative;
  display: inline-grid;
  align-items: stretch;
  min-width: 0;
  vertical-align: middle;
}

.bb-select__native {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

.bb-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bb-spacing-3);
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 14px 0 10px;
  border: 1px solid transparent;
  border-radius: var(--bb-radius-md);
  color: var(--bb-interface-control-foreground);
  background: transparent;
  font-family: var(--bb-font-family-body);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-bold);
  line-height: 1.2;
  text-align: left;
}

.bb-select__trigger:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *),
.bb-select[data-specimen-state="focusVisible"] .bb-select__trigger {
  border-color: var(--bb-interface-control-focus-ring);
  outline: none;
}

.bb-interface-controls .bb-select__trigger:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *) {
  border-color: transparent;
}

.bb-select__value {
  min-width: 0;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bb-select__font-preview {
  font-family: var(--bb-select-font-preview-family);
  font-weight: var(--bb-font-weight-regular);
}

.bb-select__caret {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin: 0 1px;
  opacity: 0.82;
  transition:
    transform var(--bb-interface-motion-quick-duration) var(--bb-interface-motion-quick-easing);
}

.bb-select:is(.is-open, [data-specimen-state="open"]) .bb-select__caret {
  transform: rotate(180deg);
}

.bb-toolbar-popover__trigger.bb-workspace-control-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}

.bb-toolbar-popover__trigger-value {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 14px;
  border: 1px solid var(--bb-interface-menu-border);
  border-radius: 0;
  background: var(--bb-toolbar-popover-trigger-value, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bb-interface-control-foreground) 14%, transparent);
}

.bb-toolbar-popover__trigger-value-icon {
  width: 9px;
  height: 9px;
  color: var(--bb-interface-control-foreground);
}

.bb-toolbar-popover__trigger[data-bb-toolbar-popover-trigger] .bb-toolbar-popover__trigger-value-icon {
  width: 9px;
  height: 9px;
}

.bb-toolbar-popover {
  position: fixed;
  z-index: 1260;
  box-sizing: border-box;
  max-width: min(320px, calc(100vw - 16px));
  padding: var(--bb-spacing-2);
  border: 1px solid var(--bb-v2-color-border-subtle);
  border-radius: var(--bb-radius-md);
  color: var(--bb-interface-control-foreground);
  background: var(--bb-v2-color-surface-canvas);
  box-shadow: var(--bb-interface-menu-shadow);
  font-family: var(--bb-font-family-body);
}

.bb-toolbar-popover[hidden] {
  display: none;
}

.bb-toolbar-popover__controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--bb-spacing-2);
}

.bb-toolbar-popover__fields {
  display: grid;
  gap: var(--bb-spacing-2);
  min-width: 0;
}

.bb-toolbar-popover__fields:has(> .bb-toolbar-popover__field) {
  grid-template-columns: max-content 68px;
}

.bb-toolbar-popover__controls + .bb-toolbar-popover__fields {
  margin-top: var(--bb-spacing-2);
}

.bb-toolbar-popover__field {
  display: grid;
  grid-template-columns: max-content 68px;
  align-items: center;
  gap: var(--bb-spacing-2);
  color: var(--bb-interface-menu-muted-foreground);
  font-family: var(--bb-font-family-body);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-medium);
  line-height: var(--bb-font-line-height-normal);
}

.bb-toolbar-popover__field-label {
  color: var(--bb-v2-color-content-secondary);
  font-family: var(--bb-font-family-body);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-semibold);
  line-height: var(--bb-font-line-height-normal);
}

.bb-toolbar-popover__field[hidden] {
  display: none;
}

.bb-toolbar-popover__fields:has(> .bb-toolbar-popover__field) > .bb-toolbar-popover__field {
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}

.bb-toolbar-popover__fields:has(> .bb-toolbar-popover__field) > :is(.bb-toolbar-popover__status, .bb-checkbox-field) {
  grid-column: 1 / -1;
}

.bb-toolbar-popover__field-input {
  width: 100%;
  min-width: 0;
}

.bb-toolbar-popover__status {
  color: var(--bb-interface-menu-muted-foreground);
  font-family: var(--bb-font-family-body);
  font-size: var(--bb-font-size-xs);
  line-height: var(--bb-font-line-height-normal);
}

.bb-toolbar-popover__color-input,
:is(.bb-toolbar-popover, .bb-color-palette) .theme-swatch {
  box-sizing: border-box;
  width: 30px;
  min-width: 30px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--bb-interface-menu-border);
  border-radius: 0;
  background: var(--swatch, transparent);
  overflow: hidden;
  cursor: pointer;
}

.bb-toolbar-popover__color-input {
  appearance: none;
}

.bb-toolbar-popover__color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.bb-toolbar-popover__color-input::-webkit-color-swatch,
.bb-toolbar-popover__color-input::-moz-color-swatch {
  border: 0;
  border-radius: 0;
}

.bb-toolbar-popover__color-input:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *)),
:is(.bb-toolbar-popover, .bb-color-palette) .theme-swatch:is(:hover, :focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *), [aria-pressed="true"]) {
  border-color: var(--bb-v2-identity-primary);
}

.bb-menu {
  display: grid;
  gap: 1px;
  padding: 5px;
  border: 1px solid var(--bb-interface-menu-border);
  border-radius: var(--bb-radius-md);
  /* The shell receives routed focus; menu items own visible focus feedback. */
  outline: none;
  color: var(--bb-interface-control-foreground);
  background: var(--bb-interface-menu-background);
  box-shadow: var(--bb-interface-menu-shadow);
  font-family: var(--bb-font-family-body);
  scrollbar-color: var(--bb-interface-menu-scrollbar-thumb) var(--bb-interface-menu-scrollbar-track);
  scrollbar-width: thin;
}

.bb-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bb-spacing-3);
  width: 100%;
  min-height: 30px;
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  color: var(--bb-interface-control-foreground);
  background: transparent;
  box-shadow: none;
  font-family: var(--bb-font-family-body);
  font-size: var(--bb-font-size-xs);
  font-weight: var(--bb-font-weight-bold);
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.bb-menu__item:is([aria-selected="true"], [data-specimen-state="selected"]):not(:disabled) {
  color: var(--bb-interface-button-pressed-foreground);
  background: var(--bb-interface-button-pressed-background);
  box-shadow: var(--bb-interface-button-pressed-shadow);
  text-shadow: var(--bb-interface-button-pressed-text-shadow);
  filter: var(--bb-interface-button-pressed-filter);
}

.bb-menu__item:disabled {
  color: var(--bb-interface-menu-disabled-foreground);
}

.bb-menu__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bb-menu__meta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.bb-menu__shortcut {
  min-width: 12px;
  color: var(--bb-interface-menu-meta-foreground);
  font-size: 11px;
  font-weight: var(--bb-font-weight-bold);
  line-height: 1;
  text-align: center;
}

.bb-menu__arrow {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
}

.bb-menu__separator {
  height: 1px;
  margin: 5px 4px;
  background: var(--bb-interface-menu-divider);
}

.bb-menu__info {
  padding: 7px 9px 3px;
  color: var(--bb-interface-menu-muted-foreground);
  font-size: 10px;
  font-weight: var(--bb-font-weight-bold);
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .bb-interface-action,
  .bb-interface-controls button:not(.theme-swatch):not([data-bb-theme-control]):not(.bb-workspace-stage-surface),
  .bb-interface-controls .bb-select__trigger,
  .bb-workspace-tab,
  .bb-workspace-control-button,
  .bb-select__caret {
    transition-duration: 0ms;
  }
}

@media (forced-colors: active) {
  .bb-select__trigger,
  .bb-menu,
  .bb-menu__item,
  .bb-workspace-tab,
  .bb-workspace-control-button,
  .bb-workspace-add-tile {
    border-color: ButtonText;
    color: ButtonText;
    background: ButtonFace;
    box-shadow: none;
    filter: none;
    forced-color-adjust: auto;
  }

  .bb-select__trigger:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *),
  .bb-menu__item:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *),
  .bb-workspace-tab:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *),
  .bb-workspace-control-button:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *),
  .bb-workspace-add-tile:focus-visible:where(:root:not([data-bb-focus-origin="pointer"]) *) {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  .bb-workspace-preview-frame[data-selected="true"]::after {
    border: var(--bb-workspace-preview-selection-stroke) solid Highlight;
    background: none;
    filter: none;
  }
}
