.bom-builder-toolbar {
  position: relative;
  z-index: 25;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bom-builder-tools { display: block; }
.bom-builder-tools > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  min-height: 40px; padding: 8px 12px; font-size: 13px; border-radius: 12px;
  border: 1px solid var(--border); color: var(--text); background: rgba(255,255,255,.035);
}
.bom-builder-tools > summary::-webkit-details-marker { display: none; }
.bom-builder-tools > summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bom-builder-tools[open] > summary svg { transform: rotate(180deg); }
.bom-builder-tools > summary:focus-visible { outline: 2px solid #9bc2ff; outline-offset: 2px; }
.bom-tab-editor .bom-builder-tools .bom-builder-lite__head-actions {
  position: absolute; top: calc(100% + 6px); right: 0;
  display: grid; grid-template-columns: minmax(0, 1fr);
  width: min(320px, calc(100vw - 32px)); max-height: 40dvh; overflow-y: auto;
  padding: 12px; gap: 10px; border: 1px solid var(--border); border-radius: 16px;
  background: #1a1c21; box-shadow: 0 14px 35px rgba(0,0,0,.35);
}
.bom-tab-editor .bom-builder-tools:not([open]) .bom-builder-lite__head-actions { display: none; }
.bom-tab-editor .bom-builder-tools .btn { min-height: 44px; font-size: 12px; }
.bom-tab-editor .bom-builder-tools .bom-builder-publication { justify-content: flex-start; }

@media (max-width: 640px) {
  /* Reserve the screen for the conversation, not repeated navigation descriptions. */
  .app:has(.bom-tab-editor) .topbar { min-height: 56px; padding-block: 6px; }
  .app:has(.bom-tab-editor) .topbar-context { display: none; }
  .app:has(.bom-tab-editor) .topbar-left { align-self: center; }
  .app:has(.bom-tab-editor) .content { padding: 6px 10px 8px; }
  .integrations-shell:has(.bom-tab-editor) .integrations-nav { padding: 0 0 4px; }
  .integrations-shell:has(.bom-tab-editor) .integrations-nav__item {
    min-width: 0; min-height: 44px; grid-template-columns: 24px auto; padding: 6px 10px; gap: 8px;
  }
  .integrations-shell:has(.bom-tab-editor) .integrations-nav__icon { width: 24px; height: 24px; border-radius: 7px; }
  .integrations-shell:has(.bom-tab-editor) .integrations-nav__icon img { width: 22px; height: 22px; }
  .integrations-shell:has(.bom-tab-editor) .integrations-nav__label strong { font-size: 13px; }
  .integrations-shell:has(.bom-tab-editor) .integrations-nav__label small { display: none; }
  .integrations-shell:has(.bom-tab-editor) .integrations-content { padding-top: 4px; }
  .bom-tab-editor .bom-workspace-nav { gap: 16px; min-height: 40px; }
  .bom-tab-editor .bom-workspace-nav__item { font-size: 12px; padding-block: 10px; }
  .bom-tab-editor .bom-builder-lite { gap: 6px; }
  .bom-tab-editor .bom-builder-lite__head { gap: 8px; align-items: stretch; padding-top: 4px; }
  .bom-tab-editor .bom-builder-lite__head .section-title { font-size: 15px; line-height: 1.35; }
  .bom-tab-editor [data-creation-stage="build"] .bom-builder-steps,
  .bom-tab-editor [data-creation-stage="build"] [data-bom-builder-description] { display: none; }
  .bom-tab-editor [data-creation-stage="start"] .bom-builder-toolbar { display: none; }
  .bom-tab-editor .bom-builder-toolbar { position: relative; gap: 8px; z-index: 25; }
  .bom-tab-editor .bom-builder-toolbar > .btn,
  .bom-builder-tools > summary {
    min-height: 40px; padding: 8px 12px; font-size: 12px; border-radius: 12px;
  }
  .bom-tab-editor .bom-builder-tools .bom-builder-lite__head-actions {
    left: 0; right: auto; width: min(320px, 100%);
  }
  .bom-tab-editor .bom-builder-mode { min-height: 32px; gap: 16px; }
  .bom-tab-editor .bom-builder-mode__item { font-size: 12px; padding-block: 6px; }
  .bom-tab-editor .bom-builder-chat-composer.chatgpt__composer {
    margin: 0 2px 2px; padding: 5px 6px; gap: 4px; border-radius: 22px;
  }
  .bom-tab-editor .bom-builder-chat-composer.chatgpt__composer textarea {
    max-height: 84px; padding-block: 5px; line-height: 1.4;
  }
  .bom-tab-editor .bom-builder-chat-composer.chatgpt__composer textarea:placeholder-shown {
    height: 34px !important; min-height: 34px; overflow-y: hidden !important;
  }
}
