@layer components {
  
  action-text-attachment[content-type^="application/vnd.actiontext"] {
    display: inline;
  }

  .mention {
    display: inline;
    padding: 0.1em 0.3em;
    margin-inline: -0.1em;
    border-radius: var(--radius-sm);
    font-weight: var(--weight-medium);
    color: var(--accent);
    background: var(--accent-sunk);
    white-space: nowrap;
  }

  .mention--extra { color: var(--ink); background: var(--surface-hover); }

  
  .task-ref {
    display: inline;
    padding: 0.1em 0.3em;
    margin-inline: -0.1em;
    border-radius: var(--radius-sm);
    background: var(--accent-sunk);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    color: var(--ink);
    text-decoration: none;
    white-space: normal;
  }

  .task-ref__number {
    font-variant-numeric: tabular-nums;
    font-weight: var(--weight-medium);
    color: var(--accent);
  }

  .task-ref:hover .task-ref__title { text-decoration: underline; }

  
  .task-ref--missing {
    background: none;
    color: var(--ink-faint);
    font-style: italic;
  }

  
  .lexxy-prompt-menu,
  .refpicker__list {
    z-index: var(--z-prompt);
    border: var(--line-w) solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-card);

    
    inline-size: 22rem;
    max-inline-size: min(30rem, var(--panel-ceiling));
    max-block-size: 17rem;

    
    padding: calc(var(--space) / 2);
    list-style: none;
  }

  
  .lexxy-prompt-menu__item,
  .refpicker__option {
    display: flex;
    align-items: center;
    gap: var(--space);
    min-height: var(--control-h-sm);
    padding-inline: calc(var(--space) / 2);
    border-radius: var(--radius-sm);
    cursor: pointer;
  }

  .refpicker__option[aria-selected="true"] { background: var(--accent-sunk); }

  .mention-prompt__name {
    font-size: var(--text-sm);
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mention-prompt__ref {
    flex: none;
    width: 5.5rem;
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    color: var(--ink-faint);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  
  .refpicker__list[popover] {
    position: fixed;
    inset: auto;
    margin: 0;
    padding: calc(var(--space) / 2);
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  
  .waiting-note a {
    position: relative;
    z-index: 1;
    text-decoration: none;
  }

  .waiting-note a:hover { text-decoration: underline; }
}
