/* The floating toolbar */
.selection-toolbar {
  position: absolute;
  z-index: 9999;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(12,20,30,0.15);
  background: linear-gradient(180deg,#ffffffee,#f6f8fb);
  border: 1px solid rgba(12,20,30,0.06);
  transform-origin: center bottom;
  transition: opacity 150ms ease, transform 150ms cubic-bezier(.22,1,.36,1);
  opacity: 0; pointer-events: none;
}

.selection-toolbar.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.selection-toolbar.hide {
  transform: translateY(6px) scale(0.96);
}

.selection-toolbar button {
  -webkit-tap-highlight-color: transparent;
  border: none; background: transparent; padding:6px; border-radius:8px; cursor:pointer; font:inherit;
  /* ensure buttons stay inline (icon + label horizontally) */
  display: inline-flex;
  flex-direction: row;
  gap:8px;
  align-items:center;
  justify-content:center;
}

.selection-toolbar button:hover { background: rgba(12,20,30,0.04); }
.selection-toolbar button:active { transform: translateY(1px); }
.selection-toolbar button .icon { font-size:14px; opacity:0.9 }
.selection-toolbar .label { font-size:0.85rem }

/* little caret triangle */
.selection-toolbar::after {
  content: "";
  position: absolute; left:50%; transform: translateX(-50%);
  bottom: -8px; width: 14px; height: 14px; background: inherit; border-left: 1px solid rgba(12,20,30,0.04);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 2px 6px rgba(12,20,30,0.06));
  border-radius:2px;
}

/* Highlight style */
/* .highlight { background: #fff6b3; padding:0 2px; border-radius:3px } */

/* Demo styles for long article text */
main {
  max-width:900px;
  margin:20px auto
}

/* Small responsive tweaks */
@media (max-width:520px){
  .selection-toolbar{ gap:4px; padding:5px; border-radius:12px }
  .selection-toolbar .label{ display:none }
}
