@layer layout {
  .app-sidebar .app-sidebar-bookmark-item > a > i {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
  }

  li.app-sidebar-bookmark-root-item.app-sidebar-bookmark-item:has(+ .app-sidebar-group) {
    margin-bottom: var(--app-spacing);
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-item {
    display: flex;
    align-items: center;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-group-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: var(--app-spacing);
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-group-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--app-muted-color);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-group-label > span {
    flex: 1;
    min-width: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-group-label > i {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu {
    margin: 0;
    margin-right: 5px;
    position: relative;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu summary:after {
    display: none;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu > summary {
    list-style: none;
    border: 0;
    background: transparent;
    color: var(--app-muted-color);
    padding: 0.25rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    line-height: 1;
    margin: 0;
    border-radius: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
      color 120ms ease,
      background 120ms ease,
      opacity 120ms ease;
    opacity: 0;
    pointer-events: none;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-item:hover .app-sidebar-bookmark-action-menu > summary,
  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-item:focus-within .app-sidebar-bookmark-action-menu > summary,
  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-group-header:hover .app-sidebar-bookmark-action-menu > summary,
  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-group-header:focus-within .app-sidebar-bookmark-action-menu > summary,
  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu[open] > summary,
  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu > summary:focus-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu > summary::-webkit-details-marker {
    display: none;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu > summary i {
    font-size: 0.95rem;
    pointer-events: none;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu[open] > summary,
  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu > summary:hover,
  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu > summary:focus-visible {
    color: var(--app-contrast);
    background: color-mix(in srgb, var(--app-contrast) 10%, transparent);
  }

  @media (hover: none), (pointer: coarse) {
    .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu > summary {
      opacity: 1;
      pointer-events: auto;
    }
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list {
    position: absolute;
    inset-inline-end: 0;
    inset-block-start: calc(100% + 4px);
    min-width: 10rem;
    max-width: calc(220px - 2 * var(--app-spacing));
    border: 1px solid var(--app-border);
    border-radius: var(--app-border-radius);
    background: var(--app-card-background-color);
    box-shadow: var(--app-dropdown-box-shadow);
    padding: 0.25rem;
    z-index: 10;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list > li {
    margin: 0;
    padding: 0;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list button {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: start;
    padding: 0.375rem 0.5rem;
    margin: 0;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.8125rem;
    line-height: 1.4;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list button:hover,
  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list button:focus-visible {
    background: color-mix(in srgb, var(--app-contrast) 8%, transparent);
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list li:has(> .app-sidebar-bookmark-action-danger) {
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px solid var(--app-border);
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list .app-sidebar-bookmark-action-danger {
    color: var(--app-action-danger-background);
  }

  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list .app-sidebar-bookmark-action-danger:hover,
  .app-sidebar #aside-panel-bookmarks .app-sidebar-bookmark-action-menu-list .app-sidebar-bookmark-action-danger:focus-visible {
    background: color-mix(in srgb, var(--app-action-danger-background) 12%, transparent);
  }
}
