.llm-page-actions {
  position: relative;
  display: block;
  margin: 0 0 0.8rem 0;
  padding: 0 0.6rem;
  user-select: none;
}

.llm-page-actions__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.4rem 0.32rem 0.55rem;
  border: 1px solid var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.08));
  border-radius: 0.3rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font: inherit;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.llm-page-actions__trigger:hover {
  border-color: var(--md-default-fg-color--light);
}

.llm-page-actions__trigger svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
  flex-shrink: 0;
}

.llm-page-actions__menu {
  position: fixed;
  min-width: 17rem;
  padding: 0.3rem;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.08));
  border-radius: 0.35rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  z-index: 1000;
}

.llm-page-actions__menu[hidden] {
  display: none;
}

.llm-page-actions__menu > button,
.llm-page-actions__menu > a {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.55rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: var(--md-default-fg-color);
  font: inherit;
  cursor: pointer;
}

.llm-page-actions__menu > button:hover,
.llm-page-actions__menu > a:hover,
.llm-page-actions__menu > button:focus-visible,
.llm-page-actions__menu > a:focus-visible {
  background: var(--md-default-fg-color--lightest);
  outline: none;
}

.llm-page-actions__menu hr {
  margin: 0.3rem 0.1rem;
  border: 0;
  border-top: 1px solid var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.08));
}

.llm-page-actions__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.llm-page-actions__icon svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.llm-page-actions__item-title {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.2;
}

.llm-page-actions__ext {
  width: 0.65rem !important;
  height: 0.65rem !important;
  opacity: 0.55;
}

.llm-page-actions__item-desc {
  display: block;
  margin-top: 0.15rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.62rem;
  line-height: 1.3;
}

[data-md-color-scheme="slate"] .llm-page-actions__trigger,
[data-md-color-scheme="slate"] .llm-page-actions__menu {
  border-color: hsla(0, 0%, 100%, 0.12);
}

[data-md-color-scheme="slate"] .llm-page-actions__menu {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.2);
}

@media print {
  .llm-page-actions { display: none; }
}
