/**
 * Link autocomplete (# theorem / ! page)
 *
 * Same shape as citation/mention autocomplete. Theorem/page/channel icons
 * use the semantic color tokens (purple/info/success). JS keeps the existing
 * .link-autocomplete-* class names and sets `top` inline.
 */

.link-autocomplete-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-md);
  max-height: 320px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  padding: var(--spacing-xs);
}

.link-autocomplete-item {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.link-autocomplete-item:hover,
.link-autocomplete-item.selected {
  background: var(--color-bg-secondary);
}

.link-item-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.link-item-icon {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  color: var(--color-text-inverse);
}

.link-item-icon.theorem-icon { background: var(--color-purple); }
.link-item-icon.page-icon    { background: var(--color-info); }
.link-item-icon.channel-icon { background: var(--color-success); }

.link-autocomplete-group {
  padding: var(--spacing-xs) var(--spacing-md) 3px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}

.link-autocomplete-group:not(:first-child) {
  margin-top: var(--spacing-xs);
  border-top: 1px solid var(--color-border-primary);
  padding-top: var(--spacing-sm);
}

/* Neutral id pill — content-tag treatment from DESIGN.md. */
.link-item-id {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  padding: 1px var(--spacing-xs);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.link-item-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Area tag — accent-tinted count-style pill from DESIGN.md. */
.link-area-tag {
  font-size: var(--font-size-xs);
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  padding: 1px var(--spacing-xs);
  border-radius: var(--radius-full);
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.link-item-preview {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: 3px;
  padding-left: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
