.tool-launcher-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.tool-launcher-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tool-launcher-button {
  flex: 0 0 11rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--button-bg);
  font-family: var(--ui-font);
  text-decoration: none;
}

.tool-launcher-description {
  margin: 0;
}

.tool-launcher-description .meta {
  display: block;
}

.tool-launcher-item.bookmarklet-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.bookmarklet-actions {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  width: min(13.4rem, calc(100% - 6rem));
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.bookmarklet-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  width: 2rem;
  min-height: 2rem;
  padding: 0.3rem;
  color: inherit;
  background: var(--button-bg);
  border: 1px solid var(--line);
  cursor: pointer;
}

.bookmarklet-copy:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.bookmarklet-feedback:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.bookmarklet-feedback {
  position: absolute;
  top: 50%;
  left: calc(100% + 0.5rem);
  transform: translateY(-50%);
  z-index: 1;
  margin: 0;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  width: max-content;
  box-sizing: border-box;
  max-width: 5.5rem;
  pointer-events: none;
}

@media (max-width: 560px) {
  .tool-launcher-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .tool-launcher-button {
    flex: 1 1 auto;
  }
}

/* /tools/bookmarklets/ page redesign. Every rule is scoped to
   .bookmarklets-page so the shared launcher styles above stay unchanged for
   /tools/. Colors come from theme tokens only. */
.bookmarklets-page .bookmarklets-lead {
  margin: 0.5rem 0 0;
  max-width: 38rem;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.bookmarklets-page .bookmarklets-hint {
  margin: 0.4rem 0 0;
  max-width: 38rem;
  line-height: 1.5;
}

.bookmarklets-page .bookmarklet-group {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.bookmarklets-page .bookmarklet-group h2 {
  margin: 0;
  line-height: 1.25;
}

.bookmarklets-page .bookmarklet-group-note {
  margin: 0.35rem 0 1.25rem;
  max-width: 38rem;
  line-height: 1.5;
}

.bookmarklets-page .tool-launcher-list {
  gap: 1.25rem;
}

.bookmarklets-page .tool-launcher-item.bookmarklet-item {
  gap: 0.35rem;
}

.bookmarklets-page .bookmarklet-actions {
  display: flex;
  align-items: stretch;
  width: auto;
  gap: 0.5rem;
}

.bookmarklets-page .tool-launcher-button {
  flex: 0 0 auto;
  justify-content: center;
  min-width: 7.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
  font-weight: 600;
  cursor: grab;
}

.bookmarklets-page .tool-launcher-button:active {
  cursor: grabbing;
}

.bookmarklets-page .tool-launcher-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.bookmarklets-page .bookmarklet-copy {
  width: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
}

/* Drag glyph for themes that do not already draw a leading icon through
   theme-nav-icons.css (word97 and chicago). */
:root:not([data-theme="word97"]):not([data-theme="chicago"]) .bookmarklets-page .tool-launcher-button::before {
  content: "";
  flex: 0 0 auto;
  width: 0.75rem;
  height: 1rem;
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cg%3E%3Ccircle cx='3' cy='3' r='1.5'/%3E%3Ccircle cx='9' cy='3' r='1.5'/%3E%3Ccircle cx='3' cy='8' r='1.5'/%3E%3Ccircle cx='9' cy='8' r='1.5'/%3E%3Ccircle cx='3' cy='13' r='1.5'/%3E%3Ccircle cx='9' cy='13' r='1.5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cg%3E%3Ccircle cx='3' cy='3' r='1.5'/%3E%3Ccircle cx='9' cy='3' r='1.5'/%3E%3Ccircle cx='3' cy='8' r='1.5'/%3E%3Ccircle cx='9' cy='8' r='1.5'/%3E%3Ccircle cx='3' cy='13' r='1.5'/%3E%3Ccircle cx='9' cy='13' r='1.5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

/* arena's muted ink token (#666 on black) is below 4.5:1; keep the quiet
   hierarchy but derive it from the primary ink token instead. */
:root[data-theme="arena"] .bookmarklets-page .bookmarklets-hint,
:root[data-theme="arena"] .bookmarklets-page .bookmarklet-group-note {
  color: var(--ink);
  opacity: 0.72;
}

@media (min-width: 640px) {
  .bookmarklets-page .tool-launcher-item.bookmarklet-item {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
  }

  .bookmarklets-page .bookmarklet-actions {
    flex: 0 0 12rem;
  }

  .bookmarklets-page .tool-launcher-description {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.fastmod-rubric-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
}

.fastmod-rubric-label input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}
