/* Baskibu Designer 0.23.0-dev59 — deterministic mobile sheets + artist palette icon */

.bbd-app.bbd-pro-workspace-v0230-dev59 {
  --bbd-v59-nav-height: 68px;
  --bbd-v59-sheet-gap: 8px;
}

/* Classical painter's palette: unmistakable from the old colour-wheel icon. */
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-v59-artist-palette {
  width: 24px !important;
  height: 21px !important;
  flex: 0 0 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
}
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-v59-artist-palette svg {
  width: 24px !important;
  height: 21px !important;
  display: block !important;
  overflow: visible !important;
}
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-v59-palette-body {
  fill: #fffaf5;
  stroke: #344054;
  stroke-width: 1.65;
  stroke-linejoin: round;
}
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-v59-thumb-hole {
  fill: #ffffff;
  stroke: #667085;
  stroke-width: 1.15;
}
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-tool--v59-background.is-active .bbd-v59-palette-body {
  fill: #fff1eb;
  stroke: #e54b14;
}

/* Old dev57/dev58 JS may reorder nodes asynchronously. CSS order is the final
   authority, so compact navigation can no longer jump around after load. */
.bbd-modal[data-layout="bottom-sheet"] .bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar[data-bbd-v59-nav="1"],
.bbd-modal[data-layout="drawer"] .bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar[data-bbd-v59-nav="1"] {
  display: grid !important;
  grid-template-columns: repeat(6,minmax(0,1fr)) !important;
  grid-auto-flow: initial !important;
}
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar .bbd-tool[data-panel="quick-designs"] { order: 1 !important; }
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar .bbd-tool[data-panel="product"] { order: 2 !important; }
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar .bbd-tool[data-panel="text"] { order: 3 !important; }
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar .bbd-tool[data-panel="image"] { order: 4 !important; }
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar .bbd-tool[data-panel="layers"] { order: 5 !important; }
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar .bbd-tool[data-panel="background"] { order: 6 !important; }
.bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar .bbd-tool[data-panel="mobile-more"] { order: 7 !important; }

.bbd-modal[data-layout="bottom-sheet"] .bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar .bbd-tool[data-bbd-v59-primary="0"],
.bbd-modal[data-layout="drawer"] .bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-sidebar .bbd-tool[data-bbd-v59-primary="0"] {
  display: none !important;
}

/* v59 sheet-open class intentionally beats the older [hidden] !important rules.
   JS also removes hidden; this CSS is a second safety net against late lifecycle
   callbacks from dev55/dev57/dev58. */
.bbd-modal[data-layout="bottom-sheet"] .bbd-app.bbd-pro-workspace-v0230-dev59:not(.is-preview-mode).is-v59-sheet-open .bbd-panel,
.bbd-modal[data-layout="bottom-sheet"] .bbd-app.bbd-pro-workspace-v0230-dev59:not(.is-preview-mode).is-v59-sheet-open .bbd-panel[hidden] {
  position: absolute !important;
  z-index: 9750 !important;
  top: auto !important;
  right: var(--bbd-v59-sheet-gap) !important;
  bottom: calc(var(--bbd-v59-nav-height) + var(--bbd-v59-sheet-gap)) !important;
  left: var(--bbd-v59-sheet-gap) !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: min(31dvh,275px) !important;
  min-height: min(190px,31dvh) !important;
  max-height: min(31dvh,275px) !important;
  display: flex !important;
  flex-direction: column !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #dfe5eb !important;
  border-radius: 17px !important;
  background: rgba(255,255,255,.995) !important;
  box-shadow: 0 -14px 36px rgba(15,23,42,.16) !important;
}

.bbd-modal[data-layout="drawer"] .bbd-app.bbd-pro-workspace-v0230-dev59:not(.is-preview-mode).is-v59-sheet-open .bbd-panel,
.bbd-modal[data-layout="drawer"] .bbd-app.bbd-pro-workspace-v0230-dev59:not(.is-preview-mode).is-v59-sheet-open .bbd-panel[hidden] {
  position: absolute !important;
  z-index: 9750 !important;
  top: 70px !important;
  right: auto !important;
  bottom: calc(var(--bbd-v59-nav-height) + 9px) !important;
  left: 9px !important;
  width: min(340px,calc(100% - 18px)) !important;
  min-width: 0 !important;
  max-width: 340px !important;
  height: auto !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  overflow: hidden !important;
  border: 1px solid #dfe5eb !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.995) !important;
  box-shadow: 0 16px 42px rgba(15,23,42,.16) !important;
}

/* Keep the selected-object mini toolbar out of the way while a main sheet is open. */
.bbd-modal[data-layout="bottom-sheet"] .bbd-app.bbd-pro-workspace-v0230-dev59.is-v59-sheet-open .bbd-context-route-toolbar,
.bbd-modal[data-layout="drawer"] .bbd-app.bbd-pro-workspace-v0230-dev59.is-v59-sheet-open .bbd-context-route-toolbar {
  display: none !important;
}

/* Sheet content owns its scroll; the canvas remains visible above it. */
.bbd-modal[data-layout="bottom-sheet"] .bbd-app.bbd-pro-workspace-v0230-dev59.is-v59-sheet-open .bbd-panel > .bbd-panel-section:not([hidden]),
.bbd-modal[data-layout="drawer"] .bbd-app.bbd-pro-workspace-v0230-dev59.is-v59-sheet-open .bbd-panel > .bbd-panel-section:not([hidden]) {
  min-height: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}
.bbd-app.bbd-pro-workspace-v0230-dev59.is-v59-sheet-open .bbd-panel > .bbd-panel-section[hidden] {
  display: none !important;
}

/* Give the painter palette a slightly larger visual footprint on phones without
   increasing the nav bar height. */
@media (max-width:430px) {
  .bbd-app.bbd-pro-workspace-v0230-dev59 { --bbd-v59-nav-height: 64px; }
  .bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-v59-artist-palette,
  .bbd-app.bbd-pro-workspace-v0230-dev59 .bbd-v59-artist-palette svg {
    width: 23px !important;
    height: 20px !important;
  }
}
