#shapeFloatingToolbar {
  position: fixed;
  padding: 8px 14px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 99999;

  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);

  transition: opacity .15s ease, transform .15s ease;
  opacity: 0;
  pointer-events: none;

  transform: translateY(-6px);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: visible;
}

.shape-toolbar-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.shape-toolbar-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.tb-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
}

.tb-btn i {
  font-size: 18px;
  color: #444;
  transition: transform .15s ease, color .2s ease;
}

.tb-label {
  font-size: 9px;
  color: #666;
  font-weight: 500;
  white-space: nowrap;
  transition: color .2s ease;
  line-height: 1;
}

.tb-btn:hover i {
  color: #e2a93b; /* BioVisuals Gold */
  transform: scale(1.12);
}

.tb-btn:hover .tb-label {
  color: #e2a93b;
}

.tb-btn.danger:hover i,
.tb-btn.danger:hover .tb-label {
  color: #e74c3c;
}
.tb-btn:disabled i,
.tb-btn:disabled .tb-label {
  color: #aaa;
  cursor: not-allowed;
}

/* Dropdown styles */
.tb-dropdown {
  position: relative;
  display: none;
}

.tb-dropdown .tb-btn {
  position: relative;
}

.tb-submenu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 4px 0;
  margin-bottom: 8px;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100000;
}

.tb-submenu::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: white;
}

/* Downward opening submenu */
.tb-dropdown.open-down .tb-submenu {
  bottom: auto;
  top: 100%;
  margin-bottom: 0;
  margin-top: 8px;
}

.tb-dropdown.open-down .tb-submenu::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: white;
}

.tb-dropdown.open .tb-submenu {
  opacity: 1;
  visibility: visible;
}

.tb-submenu button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: #444;
  transition: background-color 0.2s ease;
}

.tb-submenu button:hover {
  background-color: #f5f5f5;
  color: #e2a93b;
}

.tb-submenu button i {
  font-size: 11px;
  width: 12px;
}

/* Marker endpoints panel */
.marker-endpoints-panel {
  padding: 6px !important;
  min-width: auto !important;
  width: max-content;
}

.marker-section {
  display: flex;
  align-items: center;
  gap: 4px;
}

.marker-section + .marker-section {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #eee;
}

.marker-section-label {
  font-size: 9px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  width: 28px;
  flex-shrink: 0;
}

.marker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
}

.marker-grid button {
  width: 28px;
  height: 28px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: none;
  background: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.marker-grid button:hover {
  background-color: #f5f5f5;
}

.marker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 13px;
  color: #444;
}

.marker-grid button:hover .marker-icon {
  color: #e2a93b;
}

.marker-grid button.active {
  background-color: #fef3e0;
}

.marker-grid button.active .marker-icon {
  color: #e2a93b;
}

/* SVG icon in toolbar buttons */
.tb-btn svg {
  transition: transform .15s ease;
}

.tb-btn:hover svg line,
.tb-btn:hover svg polyline {
  stroke: #e2a93b;
  fill: #e2a93b;
}

/* Tooltip styles */
.tb-btn {
  position: relative;
}

.tb-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 100000;
  margin-bottom: 6px;
}

.tb-btn::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 100000;
  margin-bottom: 3px;
}

.tb-btn:hover::after,
.tb-btn:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Hide tooltip when submenu is open */
.tb-dropdown.open .tb-btn::after,
.tb-dropdown.open .tb-btn::before {
  opacity: 0;
  visibility: hidden;
}

#lockedUnlockBadge {
  position: fixed;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  cursor: pointer;

  transition: opacity .12s ease, transform .12s ease;
  opacity: 0;
  pointer-events: none;
}

#lockedUnlockBadge i {
  font-size: 18px;
  color: #10b981; /* green unlock symbol */
}

.locked-badge-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.locked-badge-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}
